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

func prog

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

Coerce an expression into a PROG logical code pointer (LCPTR).

Syntax



   prog (value)

During the evaluation of the parameter to this function, the search path used for procedure name lookups is restricted to the program file (PROG).

Formal Declaration



   prog:prog (value:any)

Parameters


value

An expression to be coerced. All types are valid.

Table 10-9 Derivation of PROG LGRP Bit Pattern

Parameter Type Action
BOOL0.1 if TRUE, 0.0 if FALSE.
U16
U32
SPTR
Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with zero fill.
S16
S32
S64
Set the SID part to zero. Right justify the original value in the low-order 32 bits of the offset part with sign extension.
LONG ClassTransfer both parts of the address unchanged.
EADDR
SADDR
Transfer the SID part unchanged. Transfer the low-order 32 bits of the offset part.
STRTransfer the ASCII bit pattern for the last eight characters in the string. Strings shorter than eight characters are treated as if they were extended on the left with nulls.

Examples



   %cmdebug > wl prog(12.304)
   PROG %12.304

Coerce the simple long pointer into a PROG logical code pointer.

   %cmdebug > wl prog( sort )
   PROG %2.346

Print the address of the procedure named sort. Note that the search path used for procedure name lookups is restricted to the program file (PROG).

   %cmdebug > wl prog(pub(24.630))
   PROG %24.630

The coercion simply changes the associated logical file. The pointer's bit pattern remains unchanged.

   $nmdat > wl prog( 1 )
   PROG $0.1

   $nmdat > wl prog( ffff )
   PROG $0.ffff

   $nmdat > wl prog( 1234abcd )
   PROG $0.1234abcd

   $nmdat > wl prog( -1 )
   PROG $0.ffffffff

   $nmdat > wl prog( 1234.5678 )
   PROG $1234.5678

   $nmdat > wl prog( true )
   PROG $0.1

   $nmdat > wl prog( "ABCDEFG" )
   PROG $414243.44454647

   $nmdat > wl prog( grp(1.2) )
   PROG $1.2

Limitations, Restrictions


none




func pibx


func pstate