Exo7
11-29-2011, 03:57 PM
It strikes me down that I didn't notice this presumed lack earlier, but are there such generic commands like the stringArray* serie, for float arrays ?
Presently I am interested in the stringArrayRemoveAtIndex functionality, having an array of floats I would like to remove either the first or second elements depending on wich is greater. Here's what I have currently:
proc float getMaxArrayValue(string $vArray[])
{
int $remove;
do
{
float $value0 = $vArray[0];
float $value1 = $vArray[1];
$remove = $value0>$value1;
stringArrayRemoveAtIndex($remove, $vArray);
}
while(size($vArray)>1);
return $vArray[0];
}
getMaxArrayValue {"6","3","7","9","5","2","4","1","0","8"};
// Result: 9 //
As you can see the proc is taking a string array as argument and outputs one float value. How would I get the same output with a float array as argument ?
Specifically, what would the equivalent be for this line:
stringArrayRemoveAtIndex($remove, $vArray);
Presently I am interested in the stringArrayRemoveAtIndex functionality, having an array of floats I would like to remove either the first or second elements depending on wich is greater. Here's what I have currently:
proc float getMaxArrayValue(string $vArray[])
{
int $remove;
do
{
float $value0 = $vArray[0];
float $value1 = $vArray[1];
$remove = $value0>$value1;
stringArrayRemoveAtIndex($remove, $vArray);
}
while(size($vArray)>1);
return $vArray[0];
}
getMaxArrayValue {"6","3","7","9","5","2","4","1","0","8"};
// Result: 9 //
As you can see the proc is taking a string array as argument and outputs one float value. How would I get the same output with a float array as argument ?
Specifically, what would the equivalent be for this line:
stringArrayRemoveAtIndex($remove, $vArray);
