Download smartBASIC user`s manual
Transcript
smart BASIC Core Functionality User Manual RIGHT$ FUNCTION Retrieves the rightmost n characters from a string. RIGHT$(string, len) STRING The rightmost segment of length len from string. Returns Exceptions Local Stack Frame Underflow Local Stack Frame Overflow Memory Heap Exhausted Arguments: string byRef string AS STRING The target string which cannot be a const string. length byVal length AS INTEGER The rightmost number of characters that are returned. Interactive Command NO 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 If ‘length’ is larger than the actual length of string then the entire string is returned. //Example :: RIGHT$.sb (See in Firmware Zip file) DIM s$ : s$="Parse" DIM new$ : new$ = RIGHT$(s$,3) PRINT new$; "\n" Expected Output: rse RIGHT$ is a core function. STRLEN FUNCTION STRLEN returns the number of characters within a string. STRLEN (string) Returns Exceptions INTEGER The number of characters within the string. Local Stack Frame Underflow Local Stack Frame Overflow Embedded Wireless Solutions Support Center: http://ews-support.lairdtech.com www.lairdtech.com/bluetooth 89 Laird Technologies Americas: +1-800-492-2320 Europe: +44-1628-858-940 Hong Kong: +852-2268-6567 x026