mIRC Home    About    Download    Register    News    Help

Print Thread
#123718 27/06/05 01:03 AM
Joined: Jun 2005
Posts: 44
B
BNX Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2005
Posts: 44
Has arrays been suggested yet?

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

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

The answer is yes.


Gone.
#123720 27/06/05 01:18 AM
Joined: Jun 2005
Posts: 44
B
BNX Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2005
Posts: 44
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,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Put the forum to "Feature Suggestions" and expand to 5 years.

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


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


If I knew now what I will know then... maybe things will have been different...
#123723 27/06/05 04:15 AM
Joined: Jul 2003
Posts: 77
B
Babel fish
Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
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


hmmm signed by me
#123724 27/06/05 07:19 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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
Joined: Jul 2003
Posts: 77
B
Babel fish
Offline
Babel fish
B
Joined: Jul 2003
Posts: 77
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


hmmm signed by me
#123726 28/06/05 02:04 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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