Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - string string literal constants http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 string              String literal constants
------------------------------------------------------------------------------
 Syntax
   "string"                                                                   .
   'string'                                                                   .
   `string`                                                                   .

 Arguments
   string is a string consisting of maximum 255 characters.

 Description
   String literal constants are used to represent character string data.
   String literals are normally surrounded with double quotation marks
   (""). Single quotation marks can also be used; this is useful for
   embedding double quotation marks within the string.

   String literals surrounded with the `` delimiters are automatically
   encrypted by the compiler. Encrypted literals can be used to prevent
   easy detection of strings in binary files (like a copyright string in
   an .exe file) or to exclude the examination of sensitive data in a
   database by an external viewer. Encrypted strings can be decrypted
   with the strdecrypt() library function.

   Line breaks using the ; character do not work within string literals.
   The following is invalid:

   ? "hello ;
   there"

   Strings can be concatenated this way:

   ? "hello" "there"  // or
   ? "hello" ;
     "there"

   These have the same effect like using the + string addition operator,
   but save the overhead of calling the respective internal library function.

   String literals bear the same length and usage rules like char
   variables. The & address operator can be directly used with string
   literals.

 Example
   #define EXAMPLE_CONSTANT
   #include example.hdr

   proc Test_string
   ? "hello"               // displays the string
   ? 'hello'               // displays the string
   ? `hello`               // displays encrypted string
   ? strdecrypt( `hello` ) // displays decrypted string
   ? 'h'     // displays 104 as this is a byte constant, not a string literal
   endproc

   proc main
   Test_string()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson