Evaluate as Variable, not String?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave B.

    Evaluate as Variable, not String?

    Hey gang, I am probably missing something basic.

    I have a bunch of arrays in one of my ASP scripts, and I need to construct
    the reference to the variable through some string contatenations.

    Example:

    - one of my variables is 'strQ1a(13)' and earlier in the script I assign a
    value to it.
    - I construct the name of this variable through code like
    response.write= "str" & myQuestionNumbe r & "(" & myrs.fields("va lue") & ")"
    - VBScript just evaluates this as a string and rather than displaying the
    VALUE of variable strQ1a(13), it justs displays "strQ1a(13) "

    How can I get it to look at this as a variable and get the value?


  • Curt_C [MVP]

    #2
    Re: Evaluate as Variable, not String?

    look at the Eval() function perhaps.



    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Dave B." <dtburr@speakea sy.net> wrote in message
    news:9sidnZvO2d _IWVDdRVn-jA@speakeasy.ne t...[color=blue]
    > Hey gang, I am probably missing something basic.
    >
    > I have a bunch of arrays in one of my ASP scripts, and I need to construct
    > the reference to the variable through some string contatenations.
    >
    > Example:
    >
    > - one of my variables is 'strQ1a(13)' and earlier in the script I assign a
    > value to it.
    > - I construct the name of this variable through code like
    > response.write= "str" & myQuestionNumbe r & "(" & myrs.fields("va lue") & ")"
    > - VBScript just evaluates this as a string and rather than displaying the
    > VALUE of variable strQ1a(13), it justs displays "strQ1a(13) "
    >
    > How can I get it to look at this as a variable and get the value?
    >
    >[/color]


    Comment

    • Dave B.

      #3
      Re: Evaluate as Variable, not String?

      Curt:

      Oh boy, how simple. I looked at that function and the description on the
      site made it seem like that wasn't the one. Should have tried it anyway.

      Thanks!
      "Curt_C [MVP]" <software_AT_da rkfalz.com> wrote in message
      news:%23XQ$vViU EHA.3504@TK2MSF TNGP11.phx.gbl. ..[color=blue]
      > look at the Eval() function perhaps.
      > http://www.devguru.com/Technologies/...kref/eval.html
      >
      >
      > --
      > Curt Christianson
      > Owner/Lead Developer, DF-Software
      > Site: http://www.Darkfalz.com
      > Blog: http://blog.Darkfalz.com
      >
      >
      > "Dave B." <dtburr@speakea sy.net> wrote in message
      > news:9sidnZvO2d _IWVDdRVn-jA@speakeasy.ne t...[color=green]
      > > Hey gang, I am probably missing something basic.
      > >
      > > I have a bunch of arrays in one of my ASP scripts, and I need to[/color][/color]
      construct[color=blue][color=green]
      > > the reference to the variable through some string contatenations.
      > >
      > > Example:
      > >
      > > - one of my variables is 'strQ1a(13)' and earlier in the script I assign[/color][/color]
      a[color=blue][color=green]
      > > value to it.
      > > - I construct the name of this variable through code like
      > > response.write= "str" & myQuestionNumbe r & "(" & myrs.fields("va lue") &[/color][/color]
      ")"[color=blue][color=green]
      > > - VBScript just evaluates this as a string and rather than displaying[/color][/color]
      the[color=blue][color=green]
      > > VALUE of variable strQ1a(13), it justs displays "strQ1a(13) "
      > >
      > > How can I get it to look at this as a variable and get the value?
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...