|
-
December 23rd, 2008, 08:36 AM
#1
Using a String as Variable Name
Once upon a time, I found a code example that allowed you to use a string as a variable name in Visual Basic 6.0.
The example was extremely simple and worked fine, so I documented it for later use. Then like all good engineers, I placed the document somewhere that it could never be found again.
The example was like SOMETHING("STRING"). So, SOMETHING("MyVar") would be the same as a variable named MyVar.
...
dim tempStr as String
for i = 0 to 5
tempStr = "MyVar" & i
SOMETHING(tempStr) = i 'not an array
next
...
I AM NOT LOOKING FOR OTHER WAYS TO DO THIS.
I AM OBSESSED WITH FINDING THIS EXACT FUNCTION AGAIN.
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|