I'd love to have the ability to store information in arryas and perhaps even have for and foreach loops. A little example of this could be something like:
var %array[]
%array[1] = coolspot
%array[2] = mirc
%array[3] = array
Or perhaps being able to set an array in 1 line instead of 3 seperate statements via comma delimiters. For example:
var %array[] = coolspot, mirc, array
Which in turn %array[1] would be coolspot, %array[2] would be mirc and %array[3] is array. This could apply for both local and non-local variables. It would also be nice if you could specify:
var %array[100]
This way the %array variable has a defined amount of static values. So once 100 items are in the array, no more can be defined, perhaps for speed or efficiency. And then perhaps the index of 0 to return the amount of items in the array, such as:
%array[0] would return the amount of items in the array.
OR if this wouldnt be an option lets use something like:
$array(ArrayName).count returns the total number of items
The array identifier could be used also to see if an array exists, or to find a specific value in an array such as:
$array(1) would return the name of the first array
$array(0) would return the total number of arrays
$array(ArrayName,1) would return the first item in the array
$array(ArrayName,*coolspot*,N) would do a wildcard searh starting at Nth position in the array.
$array(ArrayName).items could be used to populate a refernece to all the items in an array used in a foreach loop.
ArrayName would be the text inbetween % and [] when an array is set. An example would be %moo[], moo would be the arrayname to reference using the $array identifier.
Theres probably more that could be done with this, however its just a general idea of what it could be used for.
Then perhaps for loop support would be great, and even perhaps foreach as well. Such as the following as an example using some arrays:
for (%i = 0, %i <= $array(moo).count, %i++) {
echo $array(moo,%i)
}
And heres an example of a foreach loop:
foreach ($array(moo).items in $array(moo)) {
echo $array(moo,$for(moo))
}
This would echo each item in the moo array
Or, another example, using a differnet format:
foreach ($array(moo).items in %moo[]) {
echo %moo[$for]
}
The $for identifier would be similar to the behavior of $readn, in which $for is automatically incremented each time the foreach loop is triggered. The N parameter of $for would reference the ArrayName so that $for can keep track of multiple nested foreach loop triggers. This way $for could keep track of multiple foreach statements that may be nested within one another without conflict. Or even, if $for is used within $array,.. $for automatically returns a result based on the ArrayName givin in the $array statement, this way no parameter (ArrayName) would be needed. Or could be based on the name of the givin array. Heres 2 examples:
foreach ($array(moo).items in %moo[]) {
echo %moo[$for]
}
$for knows to retreieve the current count for %moo since it is incased in the %moo[] array. Or perhaps:
foreach ($array(moo).items in $array(moo)) {
echo $array(moo,$for)
}
Would do the same as stated above but its a little more code.
Array's could be stored in the variables.ini file as follows:
%moo[1] coolspot
%moo[2] testing
%moo[3] array
or perhaps this way:
%moo[
coolspot
testing
array
]
The []'s indicated the start and end of the array values. Or if a static array size was indicated when created the array, it could be something like:
%moo[3,1] coolspot
%moo[3,2] testing
%moo[3,3] array
or:
%moo[3
coolspot
testing
array
]
Which would tell mirc that the array has been allocated for 3 values. If more items are created, it will fail since the array was defined as having a maxium size of 3.
It would also be nice to be able to use /hsave to save the values to a hash table if need be, then the user could repopulate his arrays via /hload. And the values in the hash would be stored like normal hash table data, however /hload would look for %*[] text patterns as the named item in the hashtable to indicate that it needs to be repopulated as an array to give access to the $array() identifer. Once loaded arrays are stored in memory for the duration of mirc being open. And if the user chooses, can /hsave them upon closing. Of course this would apply to local arrays only since non-local arrays are stored in variables.ini respectivly.
Ok, I'm done now, sorry for the long post, just thought it may be worth while. Hope to see these features in later versions. Keep up the great work! Oh and one last little tidbit, it'd be nice if $scriptline would return a value regardless if an event was triggered or not so it can be used within an alias and the latter. Take care everyone!