mIRC Homepage
Posted By: keeker remembering checkbox values - 07/08/03 03:17 AM
is there an easy way for mirc to remember wheather a checkbox had a check mark or not in a dialog called with /dialog -m ?

basically what i want is if a check box was marked with a check box when the dialog was last closed, then a check mark should appear when it is reopened, is there a way to do this without setting hundreds of variables.

thanks for any help


cool
Posted By: codemastr Re: remembering checkbox values - 07/08/03 03:19 AM
It is your job to remember what was checked. If you don't want to store it in variables, then use either a hash table or an ini file.
Posted By: Ancyker Re: remembering checkbox values - 07/08/03 03:20 AM
heres a sample from my script..hope u learn by seeing lol

in this case my ID is 31 and my dialog is themex8 change %timestamp to somthing easy to remember and related to ur button

on *:dialog:themex8:init:0: {
if ( %timestamp == 1 ) did -c themex8 31
}
on *:dialog:themex8:sclick:31: {
if ( %timestamp == 1 ) { /set %timestamp 0 | halt }
if ( %timestamp == 0 ) { /set %timestamp 1 | halt }
if ( %timestamp == $null ) { /set %timestamp 1 | halt }
}

ooo sorry just misread it..lol um other than this way, or hash table, i dont think u can do it...unless u put it in a text file on a line and have each line represent a setting?
Posted By: keeker Re: remembering checkbox values - 07/08/03 04:01 AM
thanks codemastr, will start setting variables ... and now if you;; excuse me, i have to go to the eye doctor after reading ancyker's post (sorry if i got the name wrong)
Posted By: codemastr Re: remembering checkbox values - 07/08/03 04:04 AM
Yeah, that yellow text does NOT look good on the beige background smile
Posted By: Ancyker Re: remembering checkbox values - 07/08/03 04:12 AM
I know, i wanted to delete it but then i thought what if he needs it for reference, so i just left it there but made it hard to see lol
Posted By: neophyte Re: remembering checkbox values - 07/08/03 05:25 AM
You can use hash tables.

if ($did(x).state == 1) { .hadd timestamp timestamping on }
if ($did(x).state == 0) { .hadd timestamp timestamping off }


Just an example.

Note that hash tables are not permanently stored, and you will lose it once mIRC is closed.
Posted By: Hammer Re: remembering checkbox values - 07/08/03 07:29 AM
You can save your hash tables to files with /hsave .. these files can then be reloaded the next time you run mIRC by /hmake-ing the tables again and then /hload-ing them.
© mIRC Discussion Forums