mIRC Homepage
Posted By: morphy arrays in mirc - 03/02/04 03:40 PM
does mirc use arreys or something like that ?
i think you know what arrey means ? smirk

i seeked in help but found nothing.
Posted By: Segosa Re: arrays in mirc - 03/02/04 06:30 PM
/help token identifiers
Posted By: Raccoon Re: arrays in mirc - 03/02/04 06:43 PM
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:
[color:000099]$+([color:006600]%[/color],[color:006600]part[/color],[color:006600].[/color],[color:006600]part[/color],[color:006600].[/color],[color:006600]part[/color])[/color]

To read from a dynamic variable, you use:
[color:990000]$([color:000099]$+([color:006600]%[/color],[color:006600]part[/color],[color:006600].[/color],[color:006600]part[/color],[color:006600].[/color],[color:006600]part[/color])[/color],2)[/color]

- Raccoon
Posted By: DaveC Re: arrays in mirc - 03/02/04 10:36 PM
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.

ex

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.
© mIRC Discussion Forums