|
-
Apr 30th, 2000, 09:24 PM
#1
Thread Starter
Lively Member
I have a savefile where I keep the name of the form that I want to load(as a string). Problem is I cant load this form using just the string.
example:
Say the name of the form is frmMain
You bring the name of the form in as a string
dim frm as string
frm = "frmMain"
Load frm
this will not work as frm is a string not an object
Question is how do I relate the the string to the object I want to load(in this case a form frmMain)?
And how do I go about loading the form once the relation is made?
Thanks 
-
Apr 30th, 2000, 09:57 PM
#2
PowerPoster
AFAIK the only thing you can do is:
a) loading existing forms
b) loading new forms from an array (ie "load frmMain(1)")
c) use the API to load a new form, but then it will not be named as your string
-
Apr 30th, 2000, 11:00 PM
#3
transcendental analytic
I think you could use the name property
Code:
For each item in Forms
if item.name=Yourstring then load item
next item
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 1st, 2000, 12:43 AM
#4
Thread Starter
Lively Member
Kedaman your example would work if I had all of the forms loaded into memory but I do not.
Unfortunately the forms collection does not include those forms that are not loaded 
Is there any way to cycle through all of the forms in a project even though they are not loaded into memory?
If not then I guess I will have to be stuck with my original idea, using a long case structure.
[Edited by Mithyrl on 05-01-2000 at 01:46 PM]
-
May 1st, 2000, 05:07 AM
#5
Hyperactive Member
Well you could put all the names into a String array and loop through, but that isnt a much better solution then your big case statement.
"People who think they know everything are a great annoyance to those of us who do."
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
|