Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#249 Overlay() doc error

v3.1
closed
David Ashley
5
2012-08-14
2007-03-25
Aviatrexx
No

The second sentence of the ooRexx documentation for the Overlay() bif is erroneous.

Background:

ooRexx doc says:

"Returns the string 'target', which, starting at the 'n'th character, is overlaid with the string 'new', padded or truncated to length 'length'. The overlay must extend beyond the end of the original 'target' string. If you specify 'length', it must be a positive whole number or zero. The default value for 'length' is the length of 'new'. If 'n' is greater than the length of the 'target' string, the string 'new' is padded at the beginning. The default 'pad' character is a blank, and the default value for 'n' is 1. If you specify 'n', it must be a positive whole number."

Object REXX for OS/2 says:

"returns the string 'target', which, starting at the 'n'th character, is overlaid with the string 'new', padded or truncated to length 'length'. If you specify 'length', it must be positive or zero. The default value for 'length' is the length of 'new'. If 'n' is greater than the length of the target string, padding is added before the 'new' string. The default 'pad' character is a blank, and the default value for 'n' is 1. If you specify 'n', it must be a positive whole number."

ANSI says:

"OVERLAY overlays the first argument onto the second. The third argument is the starting position of the overlay. The fourth argument is the length of the overlay and the fifth is the padding character."

(I'm not sure but I think that's my prose, and it sucks. The only way I got by with it was that it was followed by the Rexx code that exactly describes what Overlay() does.)

TSO/REXX says:

"returns the string 'target', which, starting at the 'n'th character, is overlaid with the string 'new', padded or truncated to length 'length'. (The overlay may extend beyond the end of the original 'target' string.) If you specify 'length', it must be a positive whole number or zero. The default value for 'length' is the length of 'new'. If 'n' is greater than the length of the 'target' string, padding is added before the 'new' string. The default 'pad' character is a blank, and the default value for 'n' is 1. If you specify 'n', it must be a positive whole number."

I recommend adopting the (apparently updated) TSO/REXX text as to whether the overlay must/may extend beyond the end.

Also, I prefer the phrase "non-negative whole number" to "positive whole number or zero", but I'll leave that up to you.

-Chip-

Discussion

  • David Ashley
    David Ashley
    2007-03-25

    Logged In: YES
    user_id=931756
    Originator: NO

    This is a duplicate of bug 1625171. It has already been fixed.

     


Anonymous


Cancel   Add attachments