evaluating strings as code? 
Author Message
 evaluating strings as code?

Does FirstBasic have an Eval() function?  Val()?

Is there any other way to execute strings as code?

Thanks.



Fri, 22 Mar 2002 03:00:00 GMT  
 evaluating strings as code?

Quote:
> Does FirstBasic have an Eval() function?  Val()?

> Is there any other way to execute strings as code?

Val(), yes, but that only returns the value of a simple number.

If you want to do full evaluation like this:

    DIM result AS EXT

    result = Eval("5+2*10")

You could use my ARDAF function solver code, although I'm not sure if I have a
version that works with FirstBasic.  There's one at my FTP site that works
with powerbasic/DLL 6.0+, and there are previous versions that work with
PowerBASIC/DOS 3.0+, and maybe there's still a QuickBASIC one floating about
somewhere.

If you'd like to see how to go about it, take a look at:

    ftp://qtj.net/pub/source/powerbasic/rdf300.zip

although version 3.0 of the PowerBASIC version has a lot of features you may
not need -- but since you asked about executing strings as code - I'll point
you there anyway, since you could modify ARDAF to become a simple interpreted
language if you wanted.

Hope that helps,

--
Quinn Tyler Jackson
http://www.qtj.net/~quinn/



Sat, 23 Mar 2002 03:00:00 GMT  
 evaluating strings as code?

Quote:
>Does FirstBasic have an Eval() function?  Val()?

No EVAL but there is a VAL function.

Quote:
>Is there any other way to execute strings as code?

Only the hard way...

BTW, if you'll press F-1 while FB is running it will pop-up the help file.

C'ya,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sat, 23 Mar 2002 03:00:00 GMT  
 evaluating strings as code?
Thanks very much.  I'll take a look at your code and see if it works on
FirstBasic.

Would you like to hear about the result?

(It may take a while.  I'm quite new to firstBasic.)



Quote:
> > Does FirstBasic have an Eval() function?  Val()?

> > Is there any other way to execute strings as code?

> Val(), yes, but that only returns the value of a simple number.

> If you want to do full evaluation like this:

>     DIM result AS EXT

>     result = Eval("5+2*10")

> You could use my ARDAF function solver code, although I'm not sure if I
have a
> version that works with FirstBasic.  There's one at my FTP site that works
> with PowerBASIC/DLL 6.0+, and there are previous versions that work with
> PowerBASIC/DOS 3.0+, and maybe there's still a QuickBASIC one floating
about
> somewhere.

> If you'd like to see how to go about it, take a look at:

>     ftp://qtj.net/pub/source/powerbasic/rdf300.zip

> although version 3.0 of the PowerBASIC version has a lot of features you
may
> not need -- but since you asked about executing strings as code - I'll
point
> you there anyway, since you could modify ARDAF to become a simple
interpreted
> language if you wanted.

> Hope that helps,

> --
> Quinn Tyler Jackson
> http://www.qtj.net/~quinn/



Sat, 23 Mar 2002 03:00:00 GMT  
 evaluating strings as code?

Quote:
> Does FirstBasic have an Eval() function?  Val()?

VAL, yes. EVAL, no.

I believe there's an expression evaluator in my old shareware product,
PBWiz, the PowerBASIC Wizard's Library. It isn't available as shareware any
more-- I sold it to Information Management Systems, which can be reached at
http://www.infoms.com. I don't know whether PBWiz will work with FirstBasic.
If IMS includes the source code with PBWiz, though, you should have no
trouble adapting it to your purposes.

No, I don't get royalties, and I don't work for IMS-- I'm just trying to be
helpful. (I work for PowerBASIC, these days.)



Tue, 09 Apr 2002 03:00:00 GMT  
 evaluating strings as code?
I was trying to figure out who "zaardvark" who "worked for PowerBASIC" and
was posting lots of messages is.

PBWiz gave it away.

MCM
(not a PBWiz user).


Quote:

>> Does FirstBasic have an Eval() function?  Val()?

>VAL, yes. EVAL, no.

>I believe there's an expression evaluator in my old shareware product,
>PBWiz, the PowerBASIC Wizard's Library. It isn't available as shareware any
>more-- I sold it to Information Management Systems, which can be reached at
>http://www.infoms.com. I don't know whether PBWiz will work with
FirstBasic.
>If IMS includes the source code with PBWiz, though, you should have no
>trouble adapting it to your purposes.

>No, I don't get royalties, and I don't work for IMS-- I'm just trying to be
>helpful. (I work for PowerBASIC, these days.)



Tue, 09 Apr 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Evaluating string encoded code with Compiler

2. Evaluating string encoded code with Compiler

3. How to evaluate a string as lisp code?

4. in iwidgets ,tabnotebook, will tcl evaluate the entire code when it runs or it will evaluate

5. Evaluating a string

6. leaving INCLUDED files and EVALUATEd strings

7. Evaluating strings as Scheme

8. how to evaluate an expression saved in a character string

9. evaluate a string

10. Evaluating String Value Within IF Statement?

11. Evaluating the contents of a string

12. evaluate string expression

 

 
Powered by phpBB® Forum Software