pascal

Sockets in Pascal

How do you use network sockets in Pascal? ...

What is the fastest way to Parse a line in Delphi?

I have a huge file that I must parse line by line. Speed is of the essence. Example of a line: Token-1 Here-is-the-Next-Token Last-Token-on-Line ^ ^ Current Position Position after GetToken GetToken is called, returning "Here-is-the-Next-Token" and sets the Cur...

Where can I find pascal-style railroad diagrams to describe C++ syntax?

(As an alternative to EBNF) ...

What would be more productive? Converting VAX PASCAL into GNU PASCAL or port it to perl or some other language.

I have this legacy code base (Compaq PERL), about 1500 lines of code, that I need to port to windows. I wanted to use gnu PASCAL (which I have installed and have working). I have already got our assembler (HP 64000 8051) off the VAX and on to Windows (KEIL 8051). The director of Software engineering would like to get all products off the...

Delphi(2006) Loop Help

So What I'm essentially trying to do is have something happen 70% of the time, another few things happen 10% of the time each if that makes sense but my app doesn't seem to do any of the actions I'm guessing I'm misunderstanding the loop syntax or something, anyway if anyone could take a look and maybe give me some advice per1 := 70; pe...

Delphi Syntax for TextMate

I exchanged emails with Marc-André Cournoyer of RefactorMyCode.com about supporting Delphi on his site. Since his site uses Ruby's UltraViolet to do syntax highlighting, and it uses TextMate syntaxes, he needs a Delphi syntax for TextMate. Turns out it has a Pascal syntax already, so it is 90% of the way there. Does anyone know where ...

Pascal to Mips Code Conversion

I'm currently working on a Mips Code Generator for my Pascal Parser (Written in C using Lex / Yacc) . Does anybode know of a Tool out there I can use as a reference in order assure correct Code Generation? ...

Is possible to include files (linking) based on a component property ?

Delphi 2007/2009 odd question here: It's possible, based on a component property defined in design-time, to include files in linking or leave them ? Example: If I leave SomeProperty true, when compiling, the unit SomeUnit will be included into my project. Otherwise it will not be included. My second approach to this problem is to depl...

Pascal syntax highlight in Visual Studio ?

Hi All, I'm writing in C# the next generation of an old app originally written in Delphi. I often have to look in the old code and wondered if there's anyway to install Pascal syntax highlighting in the Visual Studio 2008 editor. TIA. ...

How to use sets of string in Pascal?

I am writing a little game in which the user is asked for their race and class. There are five possible races of string[5] and four possible classes of string[9]. How do I program pascal to 1. define the five races and four classes as constants, 2. check the user input to see whether the input is within the possible races and classes -...

How to convert OWL/BP7 application to Delphi?

Which tool/approach would you suggest to convert of a large 16bit Windows GUI application, written in old Borland Pascal 7 / OWL, to Delphi? Understanding the pretty heavy differences between OWL and VCL, as well as the differences between the pointer manipulations in 16bit pascal and the state-of-art using of strings and objects in De...

Are there any static code analysis tools for Delphi/Pascal?

Are there any static code analysis tools for Delphi/Pascal? I have seen plenty of options for C++ and .NET, but nothing for Delphi/Pascal. Ideally something that could be integrated into a continuous integration system. ...

How can I perform the equivalent of shellexecute() in Lazarus for a Mac?

How can I perform the equivalent of shellexecute() in Lazarus for a Mac? ...

Delphi - Accessing data from dynamic array that is populated from an untyped Pointer

Hi im using Delphi 2009 not that it has a large affect on what im doing i think I would run into the same if i was still on 2007. I have a scsi call that outputs data to a pointer (wrong way of looking at it but i have trouble explaining that). Originally i used Move to populate a Static Array of Byte with the data that came back, but ...

Delphi Pascal Problem when WMDeviceChange function calls other functions/procedures.

SOLVED I am using delphi 2009. My program listens for usb drives being connected and remove. Ive used a very similar code in 10 apps over the past year. It has always worked perfectly. When i migrated i had to give up using thddinfo to get the drive model. This has been replaced by using WMI. The WMI query requires the physical di...

Delphi - Enumerating SATA IO Port Numbers in Windows

New one for you. Im getting ready to help another programmer port his program from C# to Delphi. I cant truly read C# nor has he sent me actual source at this point so from discussion i think im going to be tackling most of this from a one function at a time standpoint. I need to be able to get the IO Port Numbers for all SATA devices...

Storing results into a record trouble

Hi I am parsing an XML file and storing the results in a record, but am having some trouble. Im trying to store the results (content of my XML tags) into the fields of my record.. My record (at the moment there is only 1 set of XML elements). I think that the Parser.curconten is causing the problem... Type TXMLAlert=Record alert...

Pascal - Re: Uses

I have the following program which very nearly works but is producing the following error when I try and compile, I have no idea how to fix it! any ideas? Forms, mainform in 'mainform.pas'... "unit1.pas(9): , or ; expected but 'IN' found; "project1 could not compile unit1.pas unit Unit1; interface uses Windows, Messages, SysUt...

How to use Unit files in Delphi

I'm just trying to get the hang of separate units to make my code more encapsulated. I'm trying to get the public/private declarations of my methods sorted out, so I can call them from other units that use testunit. In this example I want to make hellofromotherunit public, but stickletters private. unit testunit; interface uses ...

Get a files last updated time using pascal (innosetup)

In the uninstall portion of an innosetup script, I'd like to add a check to see if a specific file's last update datetime occured within the last 10 mins. Does anyone know the innosetup compatable pascal code for this? ...