you can't call it "good" or "bad" as the sole purpose of $rand is to return a random number and by definition, while highly unlikely, $rand(1,100) could be the same number several times over
its used when you don't want to return any extraneous data, i.e.
if you use /echo $regex(aa,/(.)/g) it would echo a 2 in your window which is generally not want you want so you use noop $regex(aa,/(.)/g) to stop it from returning a value.
its similar to
var %variable = $regex(aa,/(.)/g) so you could perform a regex match without having to echo anything
not meaning to hi-jack your post but here's my method of using arrays, supports multi-dimensional arrays, and multi-type keys(int or string)
Code
syntax:
$array(<array>) ; creates the array
$array(<array>,index,data).set() ; sets data
$array(<array>,index).get() ; retrieves data
examples:
$array(test)
$array(test,1,this is stored in index 1).set()
$array(test,2,1,this is stored in index 2[1]).set()
$array(test,1).get() returns "this is stored in index 1"
$array(test,2,1).get() returns "this is stored in index 2[1]"
$array(test,4).get() returns $null
even if the code is completely different it still has the same concept.
instead of having $<array> you should keep it all in one alias, i.e. $array(<name>,<index>[,<index>]) that way you don't run the chance that an alias will be overridden
I'm confused about your syntax on how to create an array
in $save_array if $1 == 1 you dont set anything
i also dont understand how your supposed to retrieve data as if you had an array "example" then according to your description you are to use $example(index); I'm not seeing how you accomplish that
for your $chk if i understood what you were trying to do you can use
Code
where \1 = array, \2 = index, \3 = values
i don't understand what a represents so i left it as a constant
Quote