DivideInto Parameters

Top  Previous  Next

DivideInto parameters divide a given number of objects into a given number of groups.


$p=divideinto(total,number of groups)




$p=divideinto(100,4)                Divides 100 into four groups. This might result in the values 22,31,15,32  or  10,31,5,54


In this example, the four results will always add up to 100


Individual elements of $p are accessed using references - $p[1], $p[2], $p[3] and $p[4].