|
Post by turbov21 on Feb 26, 2008 17:18:05 GMT -5
Is it possible to create handles like we create variables? I'm trying to, I guess, create classes, use the handle as a kind of namespace... Have a file, "HELLO.BAS"... hello$ = "Hi, hi!" bye$ = "Bye, bye!" Then summon that... run "hello", #hi print #hi hello$ That's kind of a basic example of what I'm thinking, and if I could create #hi just by declaring it like I would hi$, that'd be even better. Is this possible?
|
|
|
Post by carlgundel on Feb 26, 2008 20:36:54 GMT -5
Is it possible to create handles like we create variables? I'm trying to, I guess, create classes, use the handle as a kind of namespace... Have a file, "HELLO.BAS"... hello$ = "Hi, hi!" bye$ = "Bye, bye!" Then summon that... run "hello", #hi print #hi hello$ That's kind of a basic example of what I'm thinking, and if I could create #hi just by declaring it like I would hi$, that'd be even better. Is this possible? Handles are just variables. They aren't namespaces or classes. Try adding a function to the hello.bas program called print() and then call it like so: #hi print(hello$) The function would just do this: function print(a$) print a$ end function -Carl
|
|
|
Post by kokenge on Mar 12, 2008 8:13:41 GMT -5
I guess I'm not understanding. I have and array of 30 items in a DB called "a$" of 2 bytes each. I want to allow a maintenance screen to change any of them.
I tried these 2 and a few others. for i = 1 to 30 textbox #a(i), a$ #a(i) setid("len2") textbox #a;i, a$ #a;i setid("len2") next i
can't get either to work. So how do I handle textbox arrays???
Thanks for the help.
|
|
|
Post by mikeukmid on Mar 12, 2008 9:05:48 GMT -5
cssid #len2, "{width:20px}" for i = 1 to 30 hVar$="#a";i textbox #hVar$, a$ #hVar$ setid("len2") #hVar$ text(i) if i mod 5=0 then print next i
Maybe this is what you are trying to achieve, using handle variables?
|
|
|
Post by kokenge on Mar 12, 2008 9:26:45 GMT -5
Yep! Exactly.. Works great.. Thanks for the help
|
|