Loading ...
Sorry, an error occurred while loading the content.

Re: eval var

Expand Messages
  • brother.gabriel
    Well, the VBS_EVAL_STR$ doesn t do what I need. I want to do this: dim myvar$ myvar$ = somestring function myfunction$(whatstring) function =
    Message 1 of 5 , Jul 1, 2011
    View Source
    • 0 Attachment
      Well, the VBS_EVAL_STR$ doesn't do what I need.
      I want to do this:

      dim myvar$
      myvar$ = "somestring"

      function myfunction$(whatstring)
      function = reverse$(whatstring)
      end function

      print eval$("myfunction$(myvar$)")



      --- In BCX@yahoogroups.com, "brother.gabriel" <brgabriel@...> wrote:
      >
      > Okay, well, that works for me too. Here is what I want to achieve:
      > I want to send an actual bcx function call set in quotations, and receive its return:
      >
      > dim mystring$
      > mystring$ = "George"
      >
      > print eval$("reverse$(mystring$)")
      >
      >
      > function eval$(whatvar$)
      > dim returnthis$
      > whatvar$ = enc$(whatvar$)
      > VBS_START
      > VBS_ADDCODE("dim whatvar")
      > returnthis$ = VBS_EVAL_STR$("whatvar")
      > VBS_STOP
      > function = returnthis$
      > end function
      >
      >
      > Is there no other way to do this besides a vbs function? For something as advanced as BCX, I am surprised there is no native way to evaluate a string as an expression.
      >
      >
      > --- In BCX@yahoogroups.com, "magic_user_68" <magic_user_68@> wrote:
      > >
      > > This worked for me.
      > >
      > > - Scott
      > >
      > > --------------------
      > >
      > > VBS_START
      > > VBS_ADDCODE("dim bob")
      > > VBS_ADDCODE("bob ="& ENC$("George"))
      > > PRINT VBS_EVAL_STR$("bob")
      > >
      > > VBS_STOP
      > >
      > >
      > > KEYPRESS
      > >
      > > ---------------------
      > >
      > > --- In BCX@yahoogroups.com, "brother.gabriel" <brgabriel@> wrote:
      > > >
      > > > Hello, y'all!
      > > >
      > > > This works:
      > > > print VBS_EVAL_STR$("2+2")
      > > >
      > > > and this compiles, but it crashes the application:
      > > > dim bob$
      > > > bob$ = "George"
      > > > print VBS_EVAL_STR$("print bob$")
      > > >
      > > > if the VBS_EVAL_STR$ isn't the right command, then what is?
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.