Hi Marcus,
I just looked at many procedure calls I had with different values of r, the dialog response I get from GetDialogAction.
So I go
if>r=1,OpenThis
if>r=2,LoadThat
etc.
But I just thought, what if I just give the procedures names like r values: 1, 2 etc. and write it like
GoSub>r
should it rightfully work?
I just tried to create a couple of functions with number names, and it was ok, but what's on the background? Are there any rules preventing this?
Thank you very much,
Olga.
An idea of procedure call, will it work?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Yes, you can do that, but it might be better to do something like:
GoSub>Sub_%r%
SRT>Sub_1
..
End>Sub_1
SRT>Sub_2
..
End>Sub_2
etc.
GoSub>Sub_%r%
SRT>Sub_1
..
End>Sub_1
SRT>Sub_2
..
End>Sub_2
etc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
I would caution you about using any single letter (or any valid key, for that matter) as a variable. Just in case your application then needs to do something like Send>r and you want to really send the letter r ...you might actually be sending the value of the variable r instead....
a lesson learned through experience.
a lesson learned through experience.