Entering literals in RPL

Category |  Applicable to |  Description |  Limitations


Category:

Top

RPL


Applicable to:

Top

All Versions


Description:

Top

How do you prevent the translation of literal values in the rpl editor?

Problem:

You enter something like 16rFF into your code, but when the code is parsed, the 16rFF is replaced with 255.

Workaround:

A workaround is to enter the value as a string, and then use the string method asNumber to convert it to a number. For example use:

    '16rff' asNumber

This will work for other literals as well, eg.:

    '3.00' asNumber
    '2r11101001' asNumber


Limitations:

Top

None


 

Copyright © 1999, ObjecTime Limited.