mIRC Home    About    Download    Register    News    Help

Topic Options
#70185 - 03/02/04 03:40 PM arrays in mirc
morphy Offline
Nutrimatic drinks dispenser

Registered: 02/02/04
Posts: 7
Loc: Germany
does mirc use arreys or something like that ?
i think you know what arrey means ? smirk

i seeked in help but found nothing.

#70186 - 03/02/04 06:30 PM Re: arrays in mirc
Segosa Offline
Ameglian cow

Registered: 07/12/03
Posts: 22
/help token identifiers

#70187 - 03/02/04 06:43 PM Re: arrays in mirc
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2590
There is no native support for arrays, but you can create dynamically named variables and simulate an array.

[color:000099]var $+(%,MyArray.,%i) = data
echo -a $($+(%,MyArray.,%i),2)[/color]

[color:000099]inc $+(%,Statistics.,$cid,.,$nick,.kick)
kick $chan $nick This is your $ord($($+(%,Statistics.,$cid,.,$nick,.kick),2)) kick.[/color]

To write to a dynamic variable, you use:

To read from a dynamic variable, you use:

- Raccoon
Well. At least I won lunch.
Good philosophy, see good in bad, I like!

#70188 - 03/02/04 10:36 PM Re: arrays in mirc
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
I wouldnt uses varables unless there VAR and you only need the array during the alais run, as lost of SET's causes problems for the script editor to display.

I use hash tables there essentially arrays
they have only one dimention , but its scope is unlimited, so just fake the dimensions.


you really want arrayname(%x,%y)
so you uses $hget(arrayname,%x $+ ~ $+ %y)

~ could be any seperator including , but then u might need to uses [ %x $+ , $+ %y ] or $chr(44) as the $hget might confuse it as a parameter seperator.