https://bugs.freedesktop.org/show_bug.cgi?id=86501
Bug ID: 86501
Summary: declaring variables: only last one initialized
Product: LibreOffice
Version: 4.3.3.2 release
Hardware: Other
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770378
--- snip ---
I use libreoffice base, i was testing some macros, and i see an important
problem.
It's a declaration variable problem.
Sub Test01
dim ID as integer 'or as long
msgbox(ID)
End Sub
====> The Box open "0"
Sub Test02
dim ID1, ID2 as integer 'or as long
msgbox(ID1)
msgbox(ID2)
End Sub
====> The first Box open ""
====> The second box open "0"
[...]
I've forgotten to specify that with many variables, just the last is
initialized to zero.
For exemple:
dim ID1, ID2, ID3, ID4 as long
Iknow that it's recommended**to initialize them but it's possible that
it's just a bug.
--- snip ---
The help (at
https://help.libreoffice.org/Basic/Using_Variables#Initial_Variable_Values)
indeed says:
"Initial Variable Values
As soon as the variable has been declared, it is automatically set to the
"Null" value. Note the following conventions:
Numeric variables are automatically assigned the value "0" as soon as they are
declared."
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs