Hello,
Can anyone help with this small problem?
Say I wanted to make a function that has optional arguments that can be passed to it such as a CreateWindow()
function that, at its most basic, only needs to have an xpos,ypos and size passed to it for it to work but for
more power users there are arguments for colour,style etc... so in other words,
CreateWindow(XPos,YPos,Size,[Colour],[Style],[Etc...]) as it would be shown in Blitz help docs.
How can I implement this? If the user misses out the later half of the args, (colour,stlye etc...) then the
function will fail as its missing the correct number of args so I need to fill these with default values if
the user goes with the simple version of the CreateWindow() function.
Is there a clean and easy way to do this?
Jason.
Can anyone help with this small problem?
Say I wanted to make a function that has optional arguments that can be passed to it such as a CreateWindow()
function that, at its most basic, only needs to have an xpos,ypos and size passed to it for it to work but for
more power users there are arguments for colour,style etc... so in other words,
CreateWindow(XPos,YPos,Size,[Colour],[Style],[Etc...]) as it would be shown in Blitz help docs.
How can I implement this? If the user misses out the later half of the args, (colour,stlye etc...) then the
function will fail as its missing the correct number of args so I need to fill these with default values if
the user goes with the simple version of the CreateWindow() function.
Is there a clean and easy way to do this?
Jason.