mIRC Homepage
Posted By: BNX Arrays - 27/06/05 01:03 AM
Has arrays been suggested yet?

%feature = %feature[arrays, would, be, cool]
Posted By: FiberOPtics Re: Arrays - 27/06/05 01:13 AM
Use the Search feature and see for yourself.

The answer is yes.
Posted By: BNX Re: Arrays - 27/06/05 01:18 AM
I dont see any other threads for "array". Just this one. But ok, just as long as someone suggested it :P
Posted By: FiberOPtics Re: Arrays - 27/06/05 01:41 AM
Put the forum to "Feature Suggestions" and expand to 5 years.

I used the search term +arrays and got a whole bunch of results.
Posted By: Hrung Re: Arrays - 27/06/05 02:00 AM
In the mean time, you can get some of the functionality of an array by using either hash tables (/help hash tables) or the token idenifiers, like $gettok. The latter I recommend for smaller amounts, where the total data + delimiters wouldn't exceed 950 chars or so. Hash tables can do a lot more -- unlimited entries, but each entry still limited to the normal maximum line length. They aren't exactly the same, but with a little creativity, you can get the same effects as an array.
Posted By: bamaboy1217 Re: Arrays - 27/06/05 04:15 AM
ya much the same functionalilty but it would be nice to have the %feature[0] however maybe the reason he hasnt implemented it is because that is a valid variable name and it might break several scripts? not sure havent chekced and too lazy to but does the parser allow [] in variable names if so.... maybe thats why...

however he could still do like $array(%feature,0) $array(%feature,1) etc just for backwards compatibilities sake and not breaking any scripts woudl used [] in variable names this is of course assuming you can...

Just a thought
Posted By: DaveC Re: Arrays - 27/06/05 07:19 AM
Since hashtable item names can be pretty well anything, i dont see any problem with just using them, I wouldnt see any problem with having arrays either, just i doubt that khaled wants to add features already implemented in other forms.

array[34,24,56]
$hget(array,34-24-56)

and if u didnt like that use

$array(34,24,56)
alias array { return $hget(array,$+($1,-,$2,-,$3)) }
Posted By: bamaboy1217 Re: Arrays - 28/06/05 01:13 AM
ya i know it can be implemented and i doubt welll ever see it in mIRC since as you said hash tables provide most of the funaility an array would provide; however, i was just stating that i didnt know if he was going to implement it if useing [] as an operator would throw off variable names in some script though is uppose i could just test it im really too lazy
Posted By: DaveC Re: Arrays - 28/06/05 02:04 AM
mahahahah arrays already exist

/set -s %array[1,2,3] blah
* Set %array[1,2,3] to blah

Now the hard part is getting the value back if using index variables, in the time i tried i couldnt do it

//set %var $+(%,array[,%i,$chr(44),%j,$chr(44),%k,])
//echo -a 1. $eval(%var,2) : 2. $($+(%,array[,%i,$chr(44),%j,$chr(44),%k,]),2) : 3. %array[1,2,3]
1. : 2. : 3. blah

only seems to come back if you hardcode the var name frown eval doesnt like variables with commas in

hoohoo enough mucking around, time to do some paying work.
© mIRC Discussion Forums