HP 3000 Manuals

func ascc [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

func ascc 

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:

          Lengths of Coerced Strings 

---------------------------------------------------------------------------------------------
|                                             |                                             |
|               Parameter Type                |                String Length                |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| U16, S16                                    | 2                                           |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| U32, S32, SPTR                              | 4                                           |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| S64, LONG class                             | 8                                           |
|                                             |                                             |
---------------------------------------------------------------------------------------------
|                                             |                                             |
| STR                                         | Parameter 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



MPE/iX 5.0 Documentation