mIRC Home    About    Download    Register    News    Help

Print Thread
#63427 09/12/03 02:39 AM
Joined: Dec 2003
Posts: 4
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Dec 2003
Posts: 4
I am having difficulty reading from some dynamic variables that I wrote to.

example:
%var1 = hi
%var2 = there
%var3 = i'm
%var4 = fine

in my script I have a loop as follows that fills a dialog drop down box:
Code:
set %uu 0
:loop
set %final %var $+ $calc(%uu + 1)  <---This part does not work right
if (%final == null) { goto loop2 }
did -a mydialog 22 %final
inc %uu
goto loop
:loop2


There has to be a way to buld a dynamic variable store it to another and then work with it from there. Any help would be appreciated.

#63428 09/12/03 04:28 AM
Joined: Dec 2003
Posts: 4
T
Self-satisified door
OP Offline
Self-satisified door
T
Joined: Dec 2003
Posts: 4
I figured out what I was doing wrong with the format of the dynamic variable. It should have been this:
set %final [ % $+ [ var $+ [ $calc(%uu +1) ] ] ]

Now I have all my data in the combo drop-down box when I init the dialog however the drop down part of the combo does not work. I know I need to add an "on sclick" event so it will act like a real drop down when I go to select one of the items in the list. What is the proper sclick format to make the box a true dropdown? Thanks.

#63429 09/12/03 01:10 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
I figured out what I was doing wrong with the format of the dynamic variable. It should have been this:
set %final [ % $+ [ var $+ [ $calc(%uu +1) ] ] ]

- Just so you know, you don't need all those evaluation brackets there. That could simply be written as set %final % $+ var $+ $calc(%uu +1) or set %final $+(%,var,$calc(%uu +1)).


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#63430 09/12/03 02:16 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I think he wanted %final to store the value of %varN, not the "%varN" name. At least that's what his code does, in an unecessarily lengthy way. The two inner pairs of brackets construct the variable name and the outer pair evaluates it.

ThunderWalker: there are tons of posts about both setting and retrieving the value of dynamic variables, use Search to find them.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard