Solved

'Indirect' function in vbscript

Posted on 2009-04-07
2
752 Views
Last Modified: 2012-05-06
Hi guys, I need something similar to excel's 'indirect' function, but in vbscript.

The idea is like this:
helloworld = 3
part1 = "hello"
part2 = "world"
myvariable = part1 & part2

In the above, myvariable would have the value of "helloworld" but what I want is for it to be the *value* of helloworld ie 3.

Kind of like INDIRECT (Part1 & Part2).

Any thoughts?
0
Comment
Question by:Nathan08
2 Comments
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 24094638
Hi Nathan08,
Try eval() function.
<%
Response.write(eval(myvariable))
%>

More details:
http://www.aspdev.org/articles/asp-eval-execute/
0
 

Author Comment

by:Nathan08
ID: 24095596
Hmm, I knew about eval but didn't think it would work in vbscript.  Anyway, it does!  Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now