HPlogo System Debug Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 8 System Debug Standard Functions

func ascc

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Coerces an expression into a string value.

Syntax

 ascc (value)  

Formal Declaration

   ascc:str (value:any) 

Parameters

value

An expression to be coerced. Its type can be anything except BOOL.

This function takes the internal bit pattern for value and treats it as a sequence of ASCII characters. The function value returned is a string made up of these characters, the length of which is determined by the natural size of value according to the following table:

Table 8-1 Length of Coerced Strings

Parameter TypeString Length
U16, S162
U32, S32, SPTR4
S64, LONG class8
EADDR, SADDR12
STRParameter string length

 

Examples

   $nmdebug > = ascc(%100+%1)

   'A'

   $nmdebug > wl strlen (ascc(%100+%1))

   $2

The expression %100+%1 is evaluated and coerced into a string value. Since the parameter type is effectively U16, the string contains two characters, a NULL (0) followed by a capital "A".

   $nmdebug > var bell strdel(ascc(7),1,1)

   $nmdebug > wl bell

   <beep>

This example builds a single-character string and assigns the result to the variable named bell. The STRDEL function is used to delete the leading NULL character, which is returned in the two-character string returned by the function ASCC.

Limitations, Restrictions

none

Feedback to webmaster