Need a loop for changing/lowering number vars... - 19/11/05 03:00 AM
mmkay, I need a script to make all variables (like the numbers on the ends) lower down, mostly because of a list script for removing something off it
I'm using hash tables
I need a way to make all the variables in between the one the person deleted to go down 1
For example
if you delete something off the list it will come as...
(in the hash table)
chan.1
#thelounge
chan.2
#moo
chan.4
#cows
chan.5
#rock
And when the list loads them
it'll only show #thelounge and #moo
I need it to show all those four by lowering the number label on them,
from chan.4 and chan.5 to chan.3 and chan.4
Thanks very much
I'm using hash tables
Code:
on *:dialog:cmd4options:dclick:4: { if ($did(cmd4options,4).seltext) { hload hcmd4vars hash-cmd4vars.hash var %i 1 while ($hget(hcmd4vars,$+(chan.,%i)) != $did(cmd4options,4).seltext) { inc %i } hdel hcmd4vars $+(chan.,%i) var %i 1 did -d cmd4options 4 %i hsave hcmd4vars hash-cmd4vars.hash } }
I need a way to make all the variables in between the one the person deleted to go down 1
For example
if you delete something off the list it will come as...
(in the hash table)
chan.1
#thelounge
chan.2
#moo
chan.4
#cows
chan.5
#rock
And when the list loads them
Code:
on *:dialog:cmd4options:init:0: { hload hcmd4vars hash-cmd4vars.hash var %i 1 while ($hget(hcmd4vars,chan. $+ %i)) { did -a cmd4options 4 $hget(hcmd4vars,chan. $+ %i) inc %i } }
it'll only show #thelounge and #moo
I need it to show all those four by lowering the number label on them,
from chan.4 and chan.5 to chan.3 and chan.4
Thanks very much