Menu

Abs() vs. ~abs

Developers
2007-07-17
2012-08-14
  • Ruurd Idenburg

    Ruurd Idenburg - 2007-07-17

    test = 43.5009
    Abs(test) => 43.5009
    test~abs => 43.5009

    test = -43.5009

    Abs(test) => 43.5009
    test~abs => program aborts, no message, no anything. wad?

     
    • Ruurd Idenburg

      Ruurd Idenburg - 2007-07-17

      Thanks Rick for confirming the behaviour. It's no big deal since the function works properly. It's just that I, as a Rexx user since the early 80's, am trying to use the tilde too for the old function calls.

       
    • Rick McGuire

      Rick McGuire - 2007-07-17

      I think you're going to have to include a fully functional program that demonstrates the problem. Test~abs is working just fine for me. Also include the ooRexx version and platform you are running this on.

       
      • Ruurd Idenburg

        Ruurd Idenburg - 2007-07-17

        Ok, is rexxtry perhaps sufficient proof? Run on Windows XP SP2.

        C:\Documents and Settings\Ruurd\Bureaublad\Oorexx>rexxtry
        REXX-ooRexx_3.1(MT) 6.01 20 Apr 2007
        rexxtry.rex lets you interactively try REXX statements.
        Each string is executed when you hit Enter.
        Enter 'call tell' for a description of the features.
        Go on - try a few... Enter 'exit' to end.
        test = -43.5009
        ........................................... rexxtry.rex on WindowsNT
        Say Abs(test)
        43.5009
        ........................................... rexxtry.rex on WindowsNT
        Say test~abs

        C:\Documents and Settings\Ruurd\Bureaublad\Oorexx>

        Also the following program shows the problem on my pc:

        / Testing Abs() function versus ~abs method /
        test = -43.5009
        postestabsfunc = Abs(test)
        postestabsmeth = test~abs
        Say "If 'test~abs' did not halt this program mysteriously I'll be darned"

         
        • Rick McGuire

          Rick McGuire - 2007-07-17

          Ok, this is a new one on me. It only appears to occur with the retail build, which will make this interesting to debug. The problem also occurs in the current trunk release, but again only with the optimized compiles. At least with the new release, you get a trap pop up :-)

           

Log in to post a comment.