|
Post by sarossell on Dec 12, 2019 4:31:40 GMT -5
If you pass a handle through a variable, apparently you can call it whatever the heck you like, and it works!
I was able to open a window using a handle with every symbol on the keyboard, even quotation marks! (But you have to use chr$(34) for those).
If you try this directly with a regular #handle name, the compiler won't let you.
Not sure what value this is, but I kind of like the idea of calling my #handles something like "$US Chart for 2020 Projections" that can be used for both the handle and the window title from the same variable.
nomainwin myHandle$ = "`~!@#$%^&*()_+-=[] " + chr$(34) + chr$(34) + " {}\|':;<>,?/A1.1a" open myHandle$ for window as #myHandle$ #myHandle$ "trapclose [quit]" wait [quit] close #myHandle$ end
|
|
|
Post by Chris Iverson on Dec 12, 2019 11:56:16 GMT -5
Huh, that's pretty interesting.
Be careful, though. I think there are some cases where handle variables don't work. I seem to recall some instances of such in the past, though I can't recall any off-hand.
|
|
|
Post by sarossell on Dec 12, 2019 12:12:23 GMT -5
Yeah, it's a cute concept, but probably not a good idea. Best to stick to more conventional syntax.
|
|