473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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" & myQuestionNumber & "(" & myrs.fields("value") & ")"
- 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?
Jul 19 '05 #1
2 2189
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." <dt****@speakeasy.net> wrote in message
news:9s********************@speakeasy.net...
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" & myQuestionNumber & "(" & myrs.fields("value") & ")"
- 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?

Jul 19 '05 #2
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_darkfalz.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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." <dt****@speakeasy.net> wrote in message
news:9s********************@speakeasy.net...
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" & myQuestionNumber & "(" & myrs.fields("value") & ")" - 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?


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Son KwonNam | last post by:
In XSLT, is this possible to get value from xml using XPath which is in XSLT variable? I mean XPath strings can be dynamic while XSL Transforming. If possible, How?? Because I'm not a...
1
by: Christoph Putz | last post by:
Hi! How can i do somewhat like saxon:evaluate in my xslt transformation? I tried to write an extension object, but in my case i need some context information (the value of an xslt-variable) to...
2
by: Rick427 | last post by:
I am new to .NET and was wondering if there is a function like the evaluate function in Cold Fusion that lets you use the value of something as a variable name instead of using a select case...
8
by: No Such Luck | last post by:
Is there anyway to literally evaluate the contents of a string in an if statement? For example: int i = 0; char * str = "i == 0"; if(str) /* I know this doesn't do what I want */ {
5
by: Csaba Gabor | last post by:
In Firefox 1.5 (this question is Mozilla specific as I am using greasemonkey) I would like to be able to use document.evaluate to return the first TD entry that shows ^\s*MySearchText\s*$. As I...
4
by: netnet | last post by:
Is it possible to evaluate a string as a method name? Something like this: Session = "loadFormFormACompany"; This is what I would like to do.... eval(Session+"()") Anyone have any ideas?
11
by: altreed | last post by:
Hi, I am new to ASP, HTML and iis. I have my asp code working so that I can retrieve my desired record from the database. I can place the data on the screen in table form. All works fine. ...
1
by: shellon | last post by:
Hi all: I met a problem when using document.evaluate() to get text content using XPath, my code is as follows: nodes = document.evaluate("/html/body/div/ul/li", document, null,XPathResult....
3
by: Sander Tekelenburg | last post by:
Situation: I store news articles as individual PHP files. Each file contains HTML and now and then some embedded PHP snippets. Serving those news articles on the Web works fine, through...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.