HPlogo System Debug Reference Manual > Chapter 10 System Debug Standard Functions

func sptr

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Coerces an expression into a short pointer.

Syntax



   sptr (value)

Formal Declaration



   sptr:sptr (value:any)

Parameters


value

An expression to be coerced. All types are valid.

Table 10-15 Derivation of the SPTR Bit Pattern

Parameter Type Action
BOOL1 if TRUE, 0 if FALSE.
U16
S16
Right justify the original 16-bit value in 32 bits with zero fill.
U32
S32
SPTR
Transfer the original bit pattern unchanged.
LONG ClassTransfer the low-order 32 bits of the address (offset part) unchanged. The segment number or SID part of the address is discarded.
EADDR
SADDR
Transfer the low-order 32 bits of the address (offset part). All other parts of the address are discarded.
STRTransfer the ASCII bit pattern for the last four characters in the string. Strings shorter than four characters are treated as if they were extended on the left with nulls.

Examples



   $nmdat > wl sptr( 1 )
   $1

   $nmdat > wl sptr( ffff )
   $ffff

   $nmdat > wl sptr( 1234abcd )
   $1234abcd

   $nmdat > wl sptr( -1 )
   $ffffffff

   $nmdat > wl sptr( 1234.5678 )
   $5678

   $nmdat > wl sptr( true )
   $1

   $nmdat > wl sptr( "ABCDEFG" )
   $44454647

   $nmdat > wl sptr( prog(1.2) )
   $2

Limitations, Restrictions


none




func sid


func stol