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 - byte byte constants http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 byte                Byte constants
------------------------------------------------------------------------------
 Syntax
   'char'                                                                     .

 Arguments
   char is an ASCII character.                                                |

 Description
   Byte constants are used to represent small numeric values.

 Example
   #define EXAMPLE_CONSTANT
   #include example.hdr

   /*
   Single quoted, single character strings are considered to be the
   ASCII value of the enclosed character. Using such byte constants is
   faster because the Force compiler uses the ASCII value at compile time,
   versus calling the asc() function at runtime.
   */
   
   proc Test_byte
   ? 'N', asc( "N" ) // identical statements, both printing the same value
   ? 'a' > 'A'       // prints .t.
   ? 'a' - 'A'       // prints 32
   
   // byte constants can be used as byte parameters to functions
   ? padl( istr( 9 ), 5, '0' ) // prints 00009
   endproc

   proc main
   Test_byte()
   endproc

See Also: numeric

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