Issue 64348 - Basic function CDec has several bugs
Summary: Basic function CDec has several bugs
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: OOo 2.0.2
Hardware: All Windows XP
: P3 Trivial with 5 votes (vote)
Target Milestone: 4.x
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2006-04-12 19:26 UTC by bmarcelly
Modified: 2017-05-20 11:05 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Demo of CDec bugs (10.34 KB, application/vnd.oasis.opendocument.text)
2006-04-12 19:28 UTC, bmarcelly
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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
Comment 4 Martin Hollmichel 2007-12-07 13:00:45 UTC
set target to 3.x according to
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 "".