Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mark Morgan Lloyd
Mattias Gaertner wrote: On Thu, 24 Mar 2011 22:40:22 +0100 Felipe Monteiro de Carvalho wrote: On Thu, Mar 24, 2011 at 7:27 PM, Mark Morgan Lloyd wrote: Would it be feasible to modify FPC so that it discarded everything preceding "program", "unit" etc? Feasable, yes, but it is probably easie

Re: [fpc-pascal] Associate initializer value with array item type

2011-03-24 Thread Jeppe Johansen
I can see why it would be interesting. Simple cases such as lookup tables based on booleans for example In many cases I've needed something like this function test(a: boolean): longint; const MyLUT: array[boolean] of longint = (0,213); // Assuming false = index 0 begin result := MyLUT[a];

[fpc-pascal] Associate initializer value with array item type

2011-03-24 Thread cobines
Hello. Let's say I have a type: TClothingType = (ctJacket, ctPants, ctShirt); and I want to associate it with color: var Colors: array[TClothingType] = (clRed, clBlue, clGreen); Is it possible to protect Colors against a change in order of items in TClothingType? Adding or removing items fro

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread ik
On Fri, Mar 25, 2011 at 00:21, Mattias Gaertner wrote: > On Thu, 24 Mar 2011 23:10:08 +0100 > Felipe Monteiro de Carvalho wrote: > > > > Commenting is better. Then the reported error line numbers are still > > > valid. > > > > Yes, but then bash won't recognize it, I suppose > > I meant: > > Orig

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mattias Gaertner
On Thu, 24 Mar 2011 23:10:08 +0100 Felipe Monteiro de Carvalho wrote: > > Commenting is better. Then the reported error line numbers are still > > valid. > > Yes, but then bash won't recognize it, I suppose I meant: Original file: #!/usr/bin/instantfpc begin end. bash is happy. Preprocessor

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Felipe Monteiro de Carvalho
> Commenting is better. Then the reported error line numbers are still > valid. Yes, but then bash won't recognize it, I suppose -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mail

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mattias Gaertner
On Thu, 24 Mar 2011 22:40:22 +0100 Felipe Monteiro de Carvalho wrote: > On Thu, Mar 24, 2011 at 7:27 PM, Mark Morgan Lloyd > wrote: > > Would it be feasible to modify FPC so that it discarded everything preceding > > "program", "unit" etc? > > Feasable, yes, but it is probably easier to make a

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Felipe Monteiro de Carvalho
On Thu, Mar 24, 2011 at 7:27 PM, Mark Morgan Lloyd wrote: > Would it be feasible to modify FPC so that it discarded everything preceding > "program", "unit" etc? Feasable, yes, but it is probably easier to make a pre-processor which removes this line, simply. -- Felipe Monteiro de Carvalho

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Robert Wolfe
On 3/24/2011 2:27 PM, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: On Thu, 24 Mar 2011, Mattias Gaertner wrote: Hi all, I would like to execute small pascal programs like normal unix scripts. For example: #!/usr/bin/instantfpc begin writeln('shebang executed'); end. Has anyone alrea

[fpc-pascal] SAX XML example

2011-03-24 Thread dibo20
Hi, There is on wiki nice tutorial about XML, but I can't find any example how to use units SAX and SAX_XML. I have very big XML and I must read it partially. Regards. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepasc

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Thu, 24 Mar 2011, Mattias Gaertner wrote: Hi all, I would like to execute small pascal programs like normal unix scripts. For example: #!/usr/bin/instantfpc begin writeln('shebang executed'); end. Has anyone already written a tool, that compiles and runs the pr

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mattias Gaertner
On Thu, 24 Mar 2011 18:38:04 +0100 (CET) Michael Van Canneyt wrote: > > > On Thu, 24 Mar 2011, Mattias Gaertner wrote: > > > Hi all, > > > > I would like to execute small pascal programs like normal unix > > scripts. For example: > > > > #!/usr/bin/instantfpc > > begin > > writeln('shebang ex

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Michael Van Canneyt
On Thu, 24 Mar 2011, Mattias Gaertner wrote: Hi all, I would like to execute small pascal programs like normal unix scripts. For example: #!/usr/bin/instantfpc begin writeln('shebang executed'); end. Has anyone already written a tool, that compiles and runs the program? As far as I know,

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mattias Gaertner
On Thu, 24 Mar 2011 16:53:54 + Henry Vermaak wrote: > On 24 March 2011 16:44, Henry Vermaak wrote: > > On 24 March 2011 16:06, Mattias Gaertner wrote: > >> Hi all, > >> > >> I would like to execute small pascal programs like normal unix > >> scripts. For example: > >> > >> #!/usr/bin/instan

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Henry Vermaak
On 24 March 2011 16:44, Henry Vermaak wrote: > On 24 March 2011 16:06, Mattias Gaertner wrote: >> Hi all, >> >> I would like to execute small pascal programs like normal unix >> scripts. For example: >> >> #!/usr/bin/instantfpc >> begin >>  writeln('shebang executed'); >> end. >> >> Has anyone al

Re: [fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Henry Vermaak
On 24 March 2011 16:06, Mattias Gaertner wrote: > Hi all, > > I would like to execute small pascal programs like normal unix > scripts. For example: > > #!/usr/bin/instantfpc > begin >  writeln('shebang executed'); > end. > > Has anyone already written a tool, that compiles and > runs the program?

[fpc-pascal] run pascal programs as scripts

2011-03-24 Thread Mattias Gaertner
Hi all, I would like to execute small pascal programs like normal unix scripts. For example: #!/usr/bin/instantfpc begin writeln('shebang executed'); end. Has anyone already written a tool, that compiles and runs the program? Mattias ___ fpc-pascal