mIRC Home    About    Download    Register    News    Help

Print Thread
arrays in mirc #70185 03/02/04 03:40 PM
Joined: Feb 2004
Posts: 7
M
morphy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 7
does mirc use arreys or something like that ?
i think you know what arrey means ? smirk

i seeked in help but found nothing.

Re: arrays in mirc #70186 03/02/04 06:30 PM
Joined: Dec 2003
Posts: 22
S
Segosa Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2003
Posts: 22
/help token identifiers

Re: arrays in mirc #70187 03/02/04 06:43 PM
Joined: Feb 2003
Posts: 2,642
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,642
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: arrays in mirc #70188 03/02/04 10:36 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.