[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-07-03 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

Rafael Lima  changed:

   What|Removed |Added

 CC||rafael.palma.l...@gmail.com

--- Comment #6 from Rafael Lima  ---
I'd say the problem is not only the inability to use Empty as a default
argument, but also that the interpreter assumes that an argument is Empty in a
peculiar manner. Consider the following code:

sub foo2(Optional v As Variant)
MsgBox IsEmpty(v)
MsgBox IsMissing(v)
end sub

sub bar2
foo2
end sub

This will return False and True which to me is the expected behavior. However,
the following code:

sub foo3(Optional v As Variant, Optional text As String)
MsgBox IsEmpty(v)
MsgBox IsMissing(v)
end sub

sub bar3
foo3(text := "dummy")
end sub

... will return True and False, which is the opposite of what I would expect,
since "v" is missing and it was not defined as Empty. See bug 143706 (already
referred here).

I guess we need to fix bug 143706 alongside with this one to have a coherent
behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-27 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

Andreas Heinisch  changed:

   What|Removed |Added

   See Also||https://bugs.documentfounda
   ||tion.org/show_bug.cgi?id=14
   ||3706

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

--- Comment #5 from Mike Kaganski  ---
(In reply to Jean-Pierre Ledure from comment #2)
> - (1) The message box returns True without any option, or with Option
> Compatible
> - (2) A syntax error is displayed with Option VBASupport 1
> 
> In other words when (1) and the call uses the := syntax, the skipped
> arguments contain Empty, not "Missing". Empty means something in this matter.

This is a bug. It must be fixed. It is orthogonal to this issue.

(In reply to Jean-Pierre Ledure from comment #4)
> a potential patch that would implement Empty as being a valid default
> value.
> This could create a conflict with Empty meaning missing in some cases in
> existing scripts.

This is not a reason to keep the two bugs.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

--- Comment #4 from Jean-Pierre Ledure  ---
(In reply to Mike Kaganski from comment #3)

> Which change is meant?

Well, a potential patch that would implement Empty as being a valid default
value.
This could create a conflict with Empty meaning missing in some cases in
existing scripts.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

--- Comment #3 from Mike Kaganski  ---
(In reply to Jean-Pierre Ledure from comment #2)
> Please do not change the actual behaviour without good reasons.

Which change is meant?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-12 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

--- Comment #2 from Jean-Pierre Ledure  ---
Consider next code:

  sub foo(Optional a, Optional b)
MsgBox IsEmpty(a)
  end sub

  sub bar
foo(b := 1)
  end sub

- (1) The message box returns True without any option, or with Option
Compatible
- (2) A syntax error is displayed with Option VBASupport 1

In other words when (1) and the call uses the := syntax, the skipped arguments
contain Empty, not "Missing". Empty means something in this matter.

That's the reason why in ScriptForge, everywhere I test the presence of an
argument to set a default value (hundredths of times ...) I use the
construction
  If IsMissing(a) Or IsEmpty(a) Then a = ...

Please do not change the actual behaviour without good reasons.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-06-11 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

Andreas Heinisch  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andreas Heinisch  ---
Repro in:
Version: 7.6.1.2 (X86_64) / LibreOffice Community
Build ID: f5defcebd022c5bc36bbb79be232cb6926d8f674
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: en-GB (de_DE); UI: en-GB
Calc: CL threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 161315] 'Empty' can't be used as a default value for arguments (Option Compatible)

2024-05-29 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=161315

Rafael Lima  changed:

   What|Removed |Added

 Blocks||127592


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=127592
[Bug 127592] [META] LibreOffice Basic macros incl."Option Compatible" modules
-- 
You are receiving this mail because:
You are the assignee for the bug.