On 13/05/2012 11:20, luciano de souza wrote:
> Hello all,
> 
> I trying to build a very small interpreter. I can type commands
> like:
> 
> $ add "Luciano de Souza"
> luchya...@gmail.com
> 
> Somewhere in my code, I can have something like:
> 
> procedure parse(commandline: string; var params: array of string);
> 
> In this case, the commandline has the format: "add %s %s". So I would
> obtain:
> 
> parse('add "Luciano de Souza"
> luchya...@gmail.com', params);
> 
> After this command, the parameter would have the following values:
> 
> params[0] := 'add'; params[1] := 'Luciano de Souza'; params[2] :=
> 'luchya...@gmail.com';
> 
> My question is: there is a way to do it easily using a standard
> class of Freepascal?
> 
> Luciano 

In my 'poor-mans interpreter' I use and pass around TStringList's 
quite a lot; although some special treatment of the string
is required, to preserve spaces within parameter strings.

L.

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to