Apache OpenOffice (AOO) Bugzilla – Issue 64348
Basic function CDec has several bugs
Last modified: 2017-05-20 11:05:09 UTC
CDec function is now documented in Basic on-line help: Converts a string expression or numeric expression to a decimal expression. Return value : Decimal number This function is known to VB programmers trying to convert VB macros into OOo macros. Next attachment is a document with macros that demonstrates the following bugs: Macro howToCrash this code crashes: dim t t = CDec("") Macro strangeConversion some values have a strange conversion: t = CDec("79228162514264400000000000000") print t ' gives 62406456049664 Other values give the same result Macro silentOverflow t = CDec("79228162514264340000000000000") print t ' gives zero Macro negativeNumber this is incorrectly recognized as a negative number: t = CDec(" 12345 - ") print t t = CDec("12345-") print t This is not the case for CLng() nor CInt()
Created attachment 35671 [details] Demo of CDec bugs
KR -> AB: Strange, trying the examples given by bmarcelly with a SRC680m162 on Linux gives: "BASIC runtime error | Not Implemented", does that mean this is only available for Windows? Anyway, please take care of this.
Started
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
I bump this issue With AOO 4.1.3 and Linux Mint x64, CDec seems to be not implemented.
Reset assigne to the default "issues@openoffice.apache.org".