Skip to main content

$ZQASCII (ObjectScript)

Converts an eight-byte string to a number.

Synopsis

$ZQASCII(string,position)
$ZQA(string,position)

Arguments

Argument Description
string A string. It can be a value, a variable, or an expression. It must be a minimum of eight bytes in length.
position Optional — A starting position in the string, expressed as a positive integer. The default is 1. Position is counted in single bytes, not eight-byte strings. The position cannot be the last byte in the string, or beyond the end of the string. A numeric position value is parsed as an integer by truncating decimal digits, removing leading zeros and plus signs, etc.

Description

The value that $ZQASCII returns depends on the arguments you use.

  • $ZQASCII(string) returns a numeric interpretation of an eight-byte string starting at the first character position of string.

  • $ZQASCII(string,position) returns a numeric interpretation of an eight-byte string beginning at the starting byte position specified by position.

$ZQASCII can return either a positive or a negative integer.

$ZQASCII issues a <FUNCTION> error if string is of an invalid length, or position is an invalid value.

Example

The following example determines the numeric interpretation of the character string "abcdefgh":

  WRITE $ZQASCII("abcdefgh")

It returns 7523094288207667809.

The following examples also return 7523094288207667809:

  WRITE !,$ZQASCII("abcdefgh",1)
  WRITE !,$ZQASCII("abcdefghxx",1)
  WRITE !,$ZQASCII("xxabcdefghxx",3)

$ZQASCII and $ASCII

$ZQASCII is similar to $ASCII except that it operates on eight byte (64-bit) words instead of single 8-bit bytes. For 16-bit words use $ZWASCII; for 32-bit words, use $ZLASCII.

$ZQASCII and $ZQCHAR

The $ZQCHAR function is the logical inverse of $ZQASCII. For example:

   WRITE $ZQASCII("abcdefgh")

returns: 7523094288207667809.

   WRITE $ZQCHAR(7523094288207667809)

returns “abcdefgh”.

See Also

Purpose of this instance: Draft documentation
DocReleaseID: HealthConnect2025.1
Content loaded from:
/staging/learning/iris-doc/2025.1.x/doc/cache/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/ensemble/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthconnect/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/healthcommon/en-us/src/
/staging/learning/iris-doc/2025.1.x/doc/security/en-us/src/
Excluded items: AADAN, ABIT, ACLOUD, AFL_adonet, AFL_ecp, AFL_icm, AFL_jdbc, AFL_netxep, AFL_sharding, AFL_xep, APMML, APOWER, ARGATEWAY, AWEBSOCKETS, AWSGI, BJAVA, BJAVNAT, BJAVPER, BJAVXEP, BJSNAT, BNET, BNETNAT, BNETODBC, BNETXEP, BPYNAT, BSPK, BTPI, BXCI, GAUTOML, GCONV, GCSP, GICM, GIKNOW, GIML, GISQ, GISR, GSCF, GSQLSRCH, GTSQ, GUIMA, PAGE_activex, PAGE_administration, PAGE_apimgr, PAGE_appdev_ides, PAGE_bi, PAGE_cachedirect, PAGE_data_migration, PAGE_data_science, PAGE_deployment, PAGE_deployment_configuration, PAGE_deployment_containers, PAGE_deployment_icm, PAGE_deployment_iko, PAGE_deployment_install, PAGE_dotnet, PAGE_dotnet_native, PAGE_dsvr, PAGE_embedded_language_development, PAGE_epython, PAGE_external_language_development, PAGE_interop, PAGE_interop_lifecycle, PAGE_interop_vdoc, PAGE_interoperability, PAGE_java, PAGE_java_jdbc, PAGE_java_native, PAGE_machine_learning, PAGE_monitoring, PAGE_multimodel, PAGE_multimodel_multidimensional, PAGE_multimodel_object, PAGE_multivalue, PAGE_native, PAGE_nodejs_native, PAGE_objectscript, PAGE_objectscript_ides, PAGE_odbc, PAGE_platform_arch_design, PAGE_pygate, PAGE_python, PAGE_python_native, PAGE_reports, PAGE_scalability, PAGE_security_authentication, PAGE_security_authorization, PAGE_studio, PAGE_zen, PAGE_zenmojo, PAGE_zenreports
FeedbackOpens in a new tab