OWBasic for Pocketviewer

Home INTRO Group DATATYPE Alphabetical Index

String Constants

String constants are used in programs for predefined texts. They can be stored in variables or directly send as a parameter to a procedure.
b$="World"
PRINT "Hello, "; b$
String constants are delimited with the character ". They cannot exceed a line of text and must therefore not contain a linefeed. Within a string each character represents itself with only few exceptions:

Written charrepresented char
Newline/Linefeed
\""
\\\
\x??character represented by the hexadecimal ASCII-code ??

Character constants are delimited with the character '. They must contain exactly one character. In the case of a special character of the above table this character has to be written with two characters in your program, like
nl&='¶':    ! newline character
cc&='\¶':   ! the character ¶
sq&='\'':   ! single quota
sp&='\x20': ! space

Home INTRO Group DATATYPE Alphabetical Index