Download BL600 smartBASIC Module
Transcript
smart BASIC User Manual STRDEESCAPE is used to convert an escaped string variable in the same memory space that the string exists in. Given all 3 byte escape sequences are reduced to a single byte, the result will never be a string longer than the original. STRDEESCAPE (string) SUBROUTINE Returns None string now contains de-escaped characters converted as follows: \r \n \t \\ “” \HH Exceptions carriage return linefeed horizontal tab \ “ ascii byte HH Local Stack Frame Underflow Local Stack Frame Overflow String De-Escape Error (E.g chrs after the \ are not recognized) Arguments string byRef string AS STRING The string to be converted in-situ. If a parsing error is encountered a nonfatal error is generated which needs to be handled otherwise the application will abort. Note: string cannot be a string constant, e.g. “the cat”, but must be a string variable and so if you must use a const string then first save it to a temp string variable and then pass it to the function Interactive Command: NO DIM S$,T$ S$=”Hello\5C40world” PRINT strlen(S$) strdeescape(S$) PRINT strlen(S$) strdeescape(S$) PRINT strlen(S$) ‘outputs 15 ‘outputs 13 S$=”Hello\40world” ‘outputs 11 S$=”Hello@world” STRDEESCAPE is a core function. STRVALDEC STRVALDEC converts a string of decimal numbers into the corresponding INTEGER signed value. www.lairdtech.com 90 Laird Technologies