mIRC Home    About    Download    Register    News    Help

Print Thread
#123718 27/06/05 01:03 AM
B
BNX
BNX
B
Has arrays been suggested yet?

%feature = %feature[arrays, would, be, cool]

#123719 27/06/05 01:13 AM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
Use the Search feature and see for yourself.

The answer is yes.

#123720 27/06/05 01:18 AM
B
BNX
BNX
B
I dont see any other threads for "array". Just this one. But ok, just as long as someone suggested it :P

#123721 27/06/05 01:41 AM
Joined: Feb 2004
Posts: 2,013
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Feb 2004
Posts: 2,013
Put the forum to "Feature Suggestions" and expand to 5 years.

I used the search term +arrays and got a whole bunch of results.

#123722 27/06/05 02:00 AM
Joined: Dec 2002
Posts: 206
H
Fjord artisan
Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 206
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.

#123723 27/06/05 04:15 AM
B
bamaboy1217
bamaboy1217
B
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

#123724 27/06/05 07:19 AM
D
DaveC
DaveC
D
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)) }

#123725 28/06/05 01:13 AM
B
bamaboy1217
bamaboy1217
B
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

#123726 28/06/05 02:04 AM
D
DaveC
DaveC
D
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.


Link Copied to Clipboard