[Gambas-user] Executing a constructed instruction
Nigel Gerrard
nigel at ...38...
Mon Jun 14 11:00:30 CEST 2004
Thanks Charlie for your reply.
Unfortunately gb.eval only works in evaluating an expression.
Here I was thinking about something that will execute the line (command) in
gambas,
thus enabling me to create the relevant code on the run.
Nigel
----- Original Message -----
From: "Charlie" <karl.reinl at ...9...>
To: <gambas-user at lists.sourceforge.net>
Sent: Sunday, June 13, 2004 8:05 PM
Subject: Re: [Gambas-user] Executing a constructed instruction
> Nigel Gerrard schrieb:
>
> > Has anybody got an idea how I might run a string as a command within
> > Gambas.
> >
> > For example:
> >
> > DIM sCommand AS String
> >
> > sCommand = "PRINT \"Hello\""
> >
> > sCommand
> >
> >
> > I'm guessing that it won't be possible without many changes to the
> > pcode compiler
> > and interpreter....and I guess it would get verycomplicated.
> >
> > Nigel
>
> Salut Nigel,
>
> try to go with gb.eval
> like this:
>
> ' Gambas module file
> PUBLIC SUB Main()
> DIM hExpression AS NEW Expression
> PRINT "use gb.eval"
> PRINT " hExpression.Text = ' 10 + 11 + 53'"
> hExpression.Text =" 10 + 11 + 53"
> PRINT " hExpression.Text result = " & hExpression.Value
> PRINT " and see also Examples/Evaluator "
> STOP
> END
>
>
> This is not as powerfull as Clipper 'Macros' was, but it is a beginning.
>
> Amicalement
> Charlie
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the new InstallShield X.
> From Windows to Linux, servers to mobile, InstallShield X is the
> one installation-authoring solution that does it all. Learn more and
> evaluate today! http://www.installshield.com/Dev2Dev/0504
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
More information about the User
mailing list