Solved

Varibles made during runtime....

Posted on 1998-09-14
7
160 Views
Last Modified: 2010-04-30
Here's what I want to do...

( No Option Explicit )
dim abc as integer
abc = 23
whatever(abc)$ = "Testing..."
msgbox whatever(abc)$ = "testing..."

Now... I'm hoping that whatever(abc)$ really is whatever23$
How can I do this?  Thanks.


0
Comment
Question by:eversoslightly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1434831
MsgBox "whatever" & cstr(abc) & "$"
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1434832
This is from the VISBAS-L Digest - 11 Sep 1998 - Special issue (#1998-1188)

'Form1 Code:
Private Sub Form_Load()
    Text1.Text = "Form2"
End Sub

Private Sub Command1_Click()
    LoadFormByName Text1.Text
End Sub

Private Sub LoadFormByName(sFormName As String)
    Dim NewForm As Form
    Set NewForm = Forms.Add(sFormName)
    NewForm.Show
End Sub

0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1434833
Sorry... thats not what I want....
what I'm looking for is....

that if
abc = 23
then when you do
whatever(abc) = "ya"

whatever23 = "ya"

But if abc = 13
then I want it to do:
whatever(abc) = "ya"
whatever13 = "ya"

I want it to make those varibles at runtime.

Hope this clarifies.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 2

Accepted Solution

by:
wj7ster earned 10 total points
ID: 1434834
This is not possible in VB (or any other language that I know of.  What you have in you code sample is an array with the name 'whatever' and you have set the 23rd element in this array to 'testing'

The correct way to read this value is:
msgbox whatever(23)

0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1434835
Ok... thank-you for the grim news :) hehe.
Thanks
0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1434836
btw, that is possible in Perl (you said its not possible in any other language)  It's called an associative array.  It goes like:
$whatever{'23'} = "Hello!";
or
$whatever{'foo'} = "bar";
0
 
LVL 2

Expert Comment

by:wj7ster
ID: 1434837
Quite right, about what I said, and I don't know Perl, and that is probably why I didn't know that it could do it... Then again, here is exactly what I said: "...or any other language that I know of...".

Good luck.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month4 days, 3 hours left to enroll

630 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