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."
I can confirm with Version: 4.4.0.0.alpha2+ Build ID: 2f342c61616418c6ad7303d7f5efa27a28378681 TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-11-16_00:33:40
This line does not do what you think it does: "dim ID1, ID2, ID3, ID4 as long" You have declared three "variant" type variables and only one "long" To make them all four "long", you must add the qualifiers to each variable name