Notice: Constant DATE_RFC7231 already defined in /home2/greeneye/public_html/comscript_manual/includes/bootstrap.inc on line 258
Parse | 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).

Parse

Parse

Converts hexadecimal (hex) variable(s) to decimal when type attribute is set to hex2vars and converts decimal variable(s) to hex when type is set to vars2hex.  When using the parse command, vars must be predefined with the set command by using the type attribute (e.g. type=int16) so ComScript knows how many bytes to parse.  See HexDecimalConversion example and the Hex and Decimal conversion section for additional help.

Attributes:

hexvar: the name of the variable containing the hex string
vars: The comma-separated list of variable names
type: vars2hex to parse the variables into a hex variable, hex2vars to parse the hex variable into variables

Example:

<set var="0xNum1,0xNum2,0xNum3" type="byte,uint16,uint32" />
<!-- NOTE: the string below is actually just a text sting of hex letters and number so the type attribute defaults to text -->
<set var="HexString" value="FFAAAAF1E2D3C4"/>
<parse type="hex2vars" hexvar="HexString" vars="0xNum1,0xNum2,0xNum3" />
<log message="0xNum1(FF)=[0xNum1] in decimal" />
<log message="0xNum2(AAAA)=[0xNum2] in decimal" />
<log message="0xNum3(F1E2D3C4)=[0xNum3] in decimal" />

<parse type="vars2hex" hexvar="HexString2" vars="0xNum1,0xNum2,0xNum3" />
<log message="num1,num2 and mum3 backinto a hex string = [HexString2]" />

<!-- NOTE: Hex vars size must be defined with type for both hex2vars and vars2hex conversions -->

<set var="x,y,z" value="255,65534,-253" type="byte,uint16,int16" />
<parse type="vars2hex" hexvar="HexString3" vars="x,y,z" />
<log message="x,y,z in a hex string = [HexString3]" />

----
log command output:

0xNum1(FF)=255 in decimal
0xNum2(AAAA)=43690 in decimal
0xNum3(F1E2D3C4)=4058174404 in decimal

num1,num2 and mum3 back into a hex string = FFAAAAF1E2D3C4

x,y,z in a hex string = FFFFFEFF03