Notice: Constant DATE_RFC7231 already defined in /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc on line 258
loadvars | ComScript Manual

Error message

  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 690 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 691 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 692 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 695 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 697 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in include_once() (line 290 of /home2/greeneye/public_html/comscript_manual/sites/default/settings.php).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in include_once() (line 291 of /home2/greeneye/public_html/comscript_manual/sites/default/settings.php).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in include_once() (line 299 of /home2/greeneye/public_html/comscript_manual/sites/default/settings.php).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in include_once() (line 306 of /home2/greeneye/public_html/comscript_manual/sites/default/settings.php).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_settings_initialize() (line 860 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in drupal_settings_initialize() (line 869 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: session_name(): Cannot change session name when headers already sent in drupal_settings_initialize() (line 872 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc:258) in _drupal_bootstrap_page_cache() (line 2485 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: session_set_save_handler(): Cannot change save handler when headers already sent in drupal_session_initialize() (line 242 of /home2/greeneye/public_html/comscript_manual/includes/session.inc).
  • Warning: session_id(): Cannot change session id when headers already sent in drupal_session_initialize() (line 266 of /home2/greeneye/public_html/comscript_manual/includes/session.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc:258) in drupal_send_headers() (line 1305 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc:258) in drupal_send_headers() (line 1305 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in book_prev() (line 775 of /home2/greeneye/public_html/comscript_manual/modules/book/book.module).
  • Warning: Cannot modify header information - headers already sent by (output started at /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc:258) in drupal_send_headers() (line 1305 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Warning: Cannot modify header information - headers already sent by (output started at /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc:258) in drupal_send_headers() (line 1305 of /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home2/greeneye/public_html/comscript_manual/includes/common.inc).

loadvars

loadvars

Primary command used to split a line of data with multiple values into individual variables.   Data is parsed based on a defined "delimiter" such as a space, comma or horizontal tab (ASCII 9). The line of data can be a string variable or a specified line read from a file.  In rare cases when no delimiter is present in the data line (e.g. hexadecimal data), the chars attribute can be substituted for the delimiter attribute and ComScript will divide the data line into equal length character strings and load each string into the defined variables.  Each variable will have a string length (number of chars) equal to the value set by the chars attribute. 

Data parsing can be a little tricky so Green Eyes has provided a detailed example profile with the ComScript download called DataLineParse that demonstrates how to parse a variety of data lines.
Users are strongly encouraged to run DataLineParse, and to look at its profile.xml file and the output file to gain a strong understanding of data parsing.

Loadvars is also used to include variables in the profile that are defined in the config.xml file.  The config.xml variables are also displayed and/or editable in the Data Interface.

Attributes:

string: the string of data to parse
delimiter: the character separating each value in the line
type: the source of the variables to load - "text" for textfiles, "string" for text strings and "xml" for the
          config.xml file
line: the integer value for the line of the file to parse (for text files only).  This attribute works well inside a
          while loop so ComScript parses a set number of lines from a file
vars: the list of one or more variables to save the data into separated by commas.  Not used with the config.xml file
multi: "True" to treat multiple instances of the delimiter as a single instance, "False" by default.  Very useful
             with space formatted output.
file: the path of the xml or text file relative to the profile's directory
chars: The number of ASCII characters to put into each variable when not using a delimiter

Example:

<loadvars file="config.xml" type="xml" />
<loadvars string="1,2,3,4,5" type="string" delimiter="," vars="a,b,c,d,e" />
    result: a=1,b=2,c=3,d=4,e=5
<loadvars string="1 20  300   4      50" type="string" delimiter=" " vars="a,b,c,d,e" multi="True" />
    ressult: a=1, b=20, c=300, d=4, e=50
<loadvars file="myFile.txt" type="text" delimiter="," line="1" vars="a,b,c,d,e" />
<loadvars file="myFile.txt" type="text" chars="2" line="1" vars="a,b,c,d,e" />
<loadvars string="0F1AFF" type="string" vars="x,y,z" chars="2" />
     result: x=0F, y=1A, z=FF