[fpc-pascal] InstantFPC and argv
Marco van de Voort
marcov at stack.nl
Mon May 7 14:40:46 CEST 2012
In our previous episode, Mattias Gaertner said:
> It's not big. The RTL lacks little functions for scripts. For
> example download an URL, get a list of files in a directory, load a
> xml file, test a RE.
> Running pascal programs as scripts is only the first step. The
> next step is to provide a bunch of units that make
> commons tasks one liners.
I agree. I've added some minor stuff in recent versions:
- base64 encode/decode in one function (instead of streaming only)
- symbolic has a simple "quickevaluate" to quick do calculations
( like 2+4+6, even simple var substitution is possible )
I recently copied the TProcess wiki example to get the output of an exe in a
string for the 3rd or 4th time, so that was my next target.
A bit like ExecuteProcess, one variant that operates on a whole cmdline (but
only the most basic separation) and one array of const style.
> That's why people use perl et al.
That is IMHO a bridge too far :-)
More information about the fpc-pascal