Optional Parameters Anywhere.
Optional Parameters Anywhere.
I think this is self-explainatory. But just in case ... If we can have these, then we can group the parameters in logical order instead of shoving all optionals at the end.
i guess, trond, he means
x( a , , b , c )
so you could skip one...
x( a , , b , c )
so you could skip one...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
i think it's not possible though
as all par's are (i assume) pushed on the stack, you can't push nothing on the stack, and you can't push an identifier on the stack as it may have the same value as the identifier
so i think i can predict fred's answer, and i guess it's the right one too: no

so i think i can predict fred's answer, and i guess it's the right one too: no

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Hmmm.
Hopefully with:
The compiler alread knows what is required when it reaches:
So, push comes to shove, it can load the stack with:
Edit:
Btw, Blueznl, would you object if this capability was made available?
Hopefully with:
Code: Select all
Procedure myProc( myPar.l = 0, myOther.l = -1, myNext,l = 10)
; stuff
EndProcedure
Code: Select all
myProc(1,,2)
- 1 (it was given)
-1 (it is the known default)
2 (it was given)
Edit:
Btw, Blueznl, would you object if this capability was made available?
@}--`--,-- A rose by any other name ..
That just looks uglyDare2 wrote:Code: Select all
myProc(1,,2)

quidquid Latine dictum sit altum videtur
well, ugly or not, i dunno 
filling in anything makes it not usefull to have optional parameters
but finally, i am not the one to object anything, i'm just a user!

filling in anything makes it not usefull to have optional parameters

but finally, i am not the one to object anything, i'm just a user!

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
i do suspect so as well, yesKale wrote:I'm sure i read somewere that optional parameters have got to be at the end of the parameter list. I don't fully understand why but it's got something to do with the internals of how PB calls procedures.

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
+1freak wrote:That just looks uglyDare2 wrote:Code: Select all
myProc(1,,2)
