#402 charin() to support whole numbers according to NUMERIC DIGIT

v4.2.0
closed
Rick McGuire
complete
5
2014-04-15
2010-09-23
U. Zinngrebe
No

Example below.

Reference 2.16 (NUMERIC DIGITS) says precision defaults to 9 digits, can be overridden by ::OPTIONS
Reference 10.5 (Whole Number Limit) says NUMERIC DIGITS default is the Platform Whole Number Limit.

This can be understood to mean that Whole Number Limit is 9 digits on all platforms, regardless of ::OPTIONS.

But anyway it is not sensible to limit charin() to 9 digit whole numbers, because files can be larger.

rc = 0 ....................................... ORex.rex on WindowsNT
say chars(file)
4763846254
.............................................. ORex.rex on WindowsNT
numeric digits 12
.............................................. ORex.rex on WindowsNT
chars = chars(file)
.............................................. ORex.rex on WindowsNT
say charin(file,chars-60,60)
Oooops ! ... try again. Incorrect call to routine
CHARIN argument 2 must be a whole number; found "4763846194"
rc = 40 ...................................... ORex.rex on WindowsNT
say datatype(chars,'W')
1
.............................................. ORex.rex on WindowsNT
'rexx -v'
Open Object Rexx Version 4.0.1
Build date: May 2 2010
Addressing Mode: 32

comparative example (showing that charin accepts shorter numbers):

rc = 0 ....................................... ORex.rex on WindowsNT
chars = right(chars(file),8)
.............................................. ORex.rex on WindowsNT
say datatype(chars,'W')
1
.............................................. ORex.rex on WindowsNT
say charin(file,chars-110,110)
9640007362
.............................................. ORex.rex on WindowsNT

Discussion

  • frank
    frank
    2012-12-17

    JFTR, this is related to bug #1023.

     
  • Rick McGuire
    Rick McGuire
    2013-11-23

    • assigned_to: Rick McGuire
    • Pending work items: --> none
    • Milestone: None --> v4.2.0
     
  • Rick McGuire
    Rick McGuire
    2013-11-25

    • status: open --> pending
    • Pending work items: none --> complete
     


Anonymous


Cancel   Add attachments