object-pascal

Adding multiple function calls to a case of in delphi?

case i of 0..99 : Function-call('bobo') ; 100..209 : function-smell('Hobo'); 210..300 : function-yikes('argh'); end; But what if I wanted 210..300 to call both function yikes and function smell? Can't figure out how thanks. ...

Where can I find a good Delphi or Object Pascal implementation for a circular buffer

My main purpose is to have a generic data buffer that I can use for transfers. I'm thinking of something along the lines of what XCopy did. Is there something already made out there or a good example one can follow? ...

How to do OOP with Pascal?

I am learning OOP with the pascal programming language.After googling the Internet, I found the OOP -- The GNU Pascal Manaul.But when I typed in the source code of the example above and compile, gpc returns: object.pas:13: error: unresolved forward declaration `Fooparent_Baz' Why would gpc fail to compile its manaul's example. PS:Che...

Output Of a Process

I'm developing a program using Lazarus, that execute gcc: var AProcess: TProcess; begin if SaveDialog1.Execute then AProcess := TProcess.Create(nil); AProcess.CommandLine := 'gcc.exe ' + SaveDialog1.FileName + ' -o ' TextField23.Text; AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes]; AProcess.Execute; AProcess.Free; en...

Basic email validation within Inno Setup script

I'm wanting to do a basic string validation within an Inno Setup script to be relatively certain the string is an email address. I just want to see that there is a '@' character followed by a '.' character and that there is at least one character on either side of these. Something similar to this regular expression: [^@]+@.+\.[^\.] Th...

How to make in Object Pascal "class of interface" (or "interface of interface") type

Hi! Look at this sample: //---------------------------------------------------------------------------- type ISomeInterface = interface procedure SomeMethod; end; // this is wrong, but illustrates that, what i need: TSomeClassWhichImplementsSomeInterface = class of ISomeInterface; var gHardCodedPointer: Pointer; // no m...

How to get a pointer to a method in a base class from a child class in delphi (object pascal)?

Hi! There is example: type TMyBaseClass = class public procedure SomeProc; virtual; end; TMyChildClass = class(TMyBaseClass) public procedure SomeProc; override; end; var SomeDelegate: procedure of object; procedure TMyBaseClass.SomeProc; begin ShowMessage('Base proc'); end; procedure TMyChildClass.SomeProc; ...

Which language was first to introduce the "in" keyword first: SQL or Object Pascal?

(Or possibly another language?) I know both SQL and Object Pascal first appeared in 1986, but I'm not sure which one had the in keyword first, so anyone who can point me to a definitive source will get my thanks and some reputation. Yes I searched for the answer, but I think my Google-fu is weak. :( ...

Why we need Delphi prism

What is the need to use delphi prism instead of Visual studio; i am a delphi programmer so i like object pascal but what else are that delphi prism have that other does not have ...