#79 "return .True" returns false in DHTML

v3.0
closed
nobody
None
5
2012-08-14
2005-06-03
Tyito
No

In DHTML event handler such as onClick, "return .True"
results in the same as "return .False". Whereas "return
0" results in the same as "return 1". These are invalid.
However other combinations work well.

This occurs on either ooRexx 3.01 or Object Rexx 2.1.3
under W2K Pro SP4.

Discussion

  • Tyito

    Tyito - 2005-06-03

    'return' instruction processing in DHTML event handler

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-02-12

    Logged In: YES
    user_id=191588
    Originator: NO

    The Rexx2Variant() function in orexxole.c was using an incorrect value for a true VT_BOOL. This is fixed in CVS.

    That fixes: onClick="return .True"

    On the other hand, the behavior for: onClick="return 0" is correct. The only valid values to return are true and false. If you return an invalid value here, the result is the same as returning true. In your example, the fact that returning 1 or returning nothing results in the new page opening is just coincidence. The new window opens if you return 9 or 18 or Z or c.

    JavaScript exhibits the same behavior, if you return any value other than true or false, the new page opens. You can prove that to yourself by adding these lines to your example:

    onClick="return(0)"
    opens window. Invalid to use 0.

    onClick="return(9)"
    opens window. Invalid to use 9.

    onClick="return('Z')"
    opens window. Invalid to use Z.

    onClick="return('c')"
    opens window. Invalid to use c.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks