Variable number of parameters for a function?

Blitz3D Forums/Blitz3D Beginners Area/Variable number of parameters for a function?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

thats prolly the best bet. but if you want to do something super dynamic, like using variants, you could always use a string or an array, and parse/use each array item

function DOWORK(myarray [])
where each item in myarray is a value of a different type

to add a twist you could make the first item in the array how the function should handle it


function dowork(myarray[])
select myarray(1)
case "DELETE PLAYER"
delete myarray(2)
case "loadplayer"
playertype = new playertype
playertype\name = myarray(2)
playertype\height = myarray(3)
playertype\weight = myarray(4)

end function