+2 to this feature!Danilo wrote:Empty expressions would be the same:Code: Select all
Ax(100,200, , , , ,4) Ax(100,200,,,,,4)
Procedure's default argument bypass Request
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Re: Procedure's default argument bypass Request
I like logic, hence I dislike humans but love computers.
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: Procedure's default argument bypass Request
+3 for empty params ("first,,,,fifth"). That's how Commodore BASIC did it, which I grew up with. 

Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: Procedure's default argument bypass Request
I'd be in favor of named parameters as it's just more clear.
(Actually I'm in favor of being able to overload procedures, but I'm pretty sure we won't get that
at least for a very long time, so...
)
(Actually I'm in favor of being able to overload procedures, but I'm pretty sure we won't get that
at least for a very long time, so...

Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
-
- Enthusiast
- Posts: 542
- Joined: Tue Apr 24, 2012 5:08 pm
- Location: Ontario, Canada
Re: Procedure's default argument bypass Request
I agree. And as you say, it's a good way to simulate overloading.Shield wrote:I'd be in favor of named parameters as it's just more clear.
Statements such as:
Code: Select all
Result = Format(Integer=x, Mask=y)
Result = Format(Double=x, Mask=y)
Code: Select all
Result = Format(,,,,,,x,,,,,,y)
Result = Format(,,,,,x,,,,,,,y)
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
~ Spike Milligan
-
- Enthusiast
- Posts: 443
- Joined: Sun Apr 06, 2008 12:54 pm
- Location: Brisbane, Qld, Australia
- Contact:
Re: Procedure's default argument bypass Request
"Blank or missing operands" should not be a problem, because parameters may only be omitted if they have a default value in the Procedure definition. That is the way it has been in VB6 for years and works well. However, having said that I'm certainly in favor of named parameters - which is a feature VB6 doesn't have!BorisTheOld wrote:Something to remember is that blank or missing operands can create problems if passed by value, since it's impossible to tell the true meaning of a value. Is it the value of the operand, or is it a marker to show that the operand is blank? Operands passed by reference are easier to manage, since a zero address indicates the absence of a value.
Re: Procedure's default argument bypass Request
And I prefer the use of asterisks, as showed at the top of this thread.
After all, Fred will decide, if ever this feature will be implemented. If both asterisks/blanks and named variables are going to be implemented, then everybody will be happy
After all, Fred will decide, if ever this feature will be implemented. If both asterisks/blanks and named variables are going to be implemented, then everybody will be happy

- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
Re: Procedure's default argument bypass Request
I stumbled upon this different times. If I only want to set one of the last optional parameters, I have to look up all standard settings of the parameters before this one. It would make things a lot easier!
pb 5.11