8.3 Commands 'FROM' and 'EXTRACT'

  ----------------------------------

 

      C-- has the unique commands 'FROM' and 'EXTRACT':

 

      The command 'FROM' has the syntax:

 

  <variable_type> <variable_name> = FROM <namefile>;

 

      This command tells the compiler to load to the output file the contents

  of <filename>, where <variable_name> is the identifier of the start of the

  code to be loaded. Here is an example of use of this command from the

  file tinydraw.c--:

 

  byte palette[PALSIZE] = FROM "TINYDRAW.PAL";  // palette buffer

 

      The command 'EXTRACT' has the syntax:

 

  <variable_type> <variable_name> = EXTRACT <namefile>, <begin>, <length>;

 

      This command tells the compiler to load to the output file from

  <filename> the number of bytes equal to <length> from offset <begin>, where

  <variable-name> is an identifier of the start of the code to be loaded.

 

  byte LIT128 = EXTRACT "8X16.FNT", 16*128, 16;

  byte LIT130 = EXTRACT "8X16.FNT", 16*130, 16;