Author Topic: CHR$(N) incorrect Documentation  (Read 10258 times)

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
CHR$(N) incorrect Documentation
« on: April 28, 2011, 12:50:59 PM »
The CHR$(n) function is incorrectly documented:

"To convert a number n into its corresponding ASCII character. n must be a numeric constant (0 to 255)"

The range of n is limited to 1..255.  This limitation is consistent with most variants of BASIC. The value of &H00 is used to mark the end of a string in many versions of BASIC.  Your documentation for ASC(x$,n) hints that this is the case for TBASIC.

If n is set to a value of 0, it will break the simulator in TRiLOGI V 6.40 build 02.

The following code will compiles w/o error but fails during simulation.  No error message is issued by the simulator, but the 2nd line of code is not executed (A is not set to 255).


A$ = chr$(0)      ' illegal value for chr$()
A = 255           ' this line of code does not execute


Just add it to your list of small things.

Gary D.