X (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
Line 24: Line 24:


==Example==
==Example==
<ol><li>The following statement would display <code>1234</code>:
The following statement would display <code>1234</code>:
<p class="code">[[PrintText statement|printText]] {'f1f2f3f4':X}
<p class="code">[[PrintText statement|printText]] {'f1f2f3f4':X}
</p></ol>
</p>


==See also==
==See also==
{{Template:String:X footer}}
{{Template:String:X footer}}

Revision as of 20:17, 9 March 2012

Hex constant method (String class)

X is an intrinsic function that returns the unencoded value of a hex-encoded string. It is a compile-time-only equivalent of HexToString. Since, in use, it acts like a hex constant, it is also documented with the "Constant methods".

X treats each input character as an input hex digit.

Syntax

%outString = string:X

Syntax terms

%outString A string variable to receive the unencoded value of the method object string.
string A hex-encoded string value.

Usage notes

  • As in all "Janus Soap" system methods with string outputs, the output %outString variable provides longstring behavior. However, this adds 28 bytes of VTBL usage to every X constant.
  • Although its utility is dubious, the following is valid and sets %x to x'01':

    %x = 'f0f1':x:x

  • X requires a method object string with an even number of bytes.
  • X is available as of Sirius Mods Version 7.3.

Example

The following statement would display 1234:

printText {'f1f2f3f4':X}

See also