Subj : Learning Pascal
To : Darryl Dunnaway
From : John Guillory
Date : Sun Jul 18 2010 05:04 pm
Re: Learning Pascal
By: Darryl Dunnaway to John Guillory on Thu Jul 15 2010 11:12 pm
> FreePascal has that same portability. It's one of the reasons I chose it to
> work with. Write once, compile for many.
Yeah, I've played with Free Pascal a little, never really looked at Lazarus.
Some things I like about pascal is the flexibility to do nearly anything and
yet still not demand case sensitivity and other quirks.... Various dialects
will do C style strings and things for you automatically.... Here's a few
things to get you started....
(untested)
Program demo;
Type MyRec = Record
Case B : Byte of
0 : Begin
Byt : Array [0 .. 3] OF Byte;
end;
1 : Begin
W : Array [0 .. 1] of Word;
end;
2 : Begin
L : LongInt;
End;
3 : S : String[3];
4 : C : Array [0 .. 3] OF Char;
End;
end;
VAR
A : MyRec;
Begin
A.W[0] := 1;
A.W[1] := 2;
WriteLn('Longint is ',A.L);
WriteLn('String is ',A.S);
A.S := 'ABC';
WriteLn('LongInt is ',A.L);
END.
Kinda like Unions in C if you've ever done that....
Another cool thing is text filters, but I'd have to dig up some reading on
that....
--- SBBSecho 2.12-Win32
* Origin: Roach Guts BBS telnet://roachguts.com 337-433-4135 (1:396/60)