dynamic creation and population of array

Pixilang programming language
Post Reply
rototom
Posts: 24
Joined: Mon Mar 14, 2022 4:12 pm

dynamic creation and population of array

Post by rototom »

hi,
i want to have a function to create an array and populate it with the arguments. fn choose(10,22,15...)
something like this:

Code: Select all

 fn choose(){
	if $0>0{
	$arr=new($0,INT)
	for ($x=1;$x<=$0;$x+1){
		$arr[$x]=//arg1...arg$0 //can't use $x because it's already used in the for conditional
		}
	}
	remove($arr)
} 
thanks for any help!
Post Reply