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

#411 changeStr()-BIF: misleading error message text

3.2.0
closed
nobody
5
2012-08-14
2007-09-13
No

Please don't shoot the messenger!
;)

Seriously, there is still a slight problem with the error message for the changeStr()-BIF only: if supplying a wrong value as the fourth argument would yield an error message pointing to the *third' argument in error (which is correct for the [caseless]changeStr-methods).

E.g. changeStr()-BIF (error message should point to fourth argument in this case):

------------ cut here ------------
F:\work\svn\oorexx\interpreter-3.x\trunk>rexx -e "say changeStr('l','hallo','-',0)"
1 - say changeStr('l','hallo','-',0)
Error 93 running INSTORE line 1: Incorrect call to method
Error 93.907: Method argument 3 must be a positive whole number; found "0"
------------ cut here ------------

Discussion

  • Rick McGuire
    Rick McGuire
    2007-09-13

    Logged In: YES
    user_id=1125291
    Originator: NO

    This is sort of a generic problem that already exists with many of the BIFs, and will not be fixed just because the option was also added to changestr(). For example, Copies('*', -1) will report the problem with argument 1. This occurs because the error is actually reported by the method version, which does not know that it has been invoked indirectly via the BIF or directly as a method. Many of the BIFs escape this problem because errors with position or length arguments don't report an argument number. So this problem is a direct consequence of complaining about the earlier error message :-)

     
  • Logged In: YES
    user_id=662126
    Originator: YES

    Hmm.

    How about the following idea for a possible (future) resolution then, that would be adequate for both, the BIF- and the method versions: instead of using the argument position number, use the argument name as used in the official ooRexx documentation? (In this particular case it would be "count".) The name already carries the meaning/semantcis, and if the coder is unsure the docs could be looked up.

     
  • Rick McGuire
    Rick McGuire
    2007-09-13

    Logged In: YES
    user_id=1125291
    Originator: NO

    All it will take is somebody with the time and inclination to go through and change all of the error messages. This ranks pretty low on my list of things to spend my time improving.

     


Anonymous


Cancel   Add attachments