Issue 64348

Summary: Basic function CDec has several bugs
Product: udk Reporter: bmarcelly <marcelly.bernard>
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, kay.ramme, oooforum
Version: OOo 2.0.2   
Target Milestone: 4.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Demo of CDec bugs none

Description bmarcelly 2006-04-12 19:26:32 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()
Comment 1 bmarcelly 2006-04-12 19:28:08 UTC
Created attachment 35671 [details]
Demo of CDec bugs
Comment 2 kay.ramme 2006-04-13 10:55:44 UTC
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.

Comment 3 ab 2006-06-20 09:34:50 UTC
Started
Comment 4 Martin Hollmichel 2007-12-07 13:00:45 UTC
set target to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Comment 5 oooforum (fr) 2017-04-12 09:48:30 UTC
I bump this issue
With AOO 4.1.3 and Linux Mint x64, CDec seems to be not implemented.
Comment 6 Marcus 2017-05-20 11:05:09 UTC
Reset assigne to the default "issues@openoffice.apache.org".