| Example 1:
|
! Variables for GetFuncResult
Length 2 & Local Word$ ! Temporary 2 byte word holder
Length 4 & Local Result$ ! 4 byte string result
Length 5.0 & Local LoResult, HiResult ! Lower/upper 16 bit value
Length 10.0 & Local BigResult ! 32 bit value
! Variables for GetPageSize
Length 5.0 & Local PageWidth, PageHeight ! Printable page size
! Program segment
.
.
Gosub GetPageSize ! Define printer page size
.
.
GetPageSize:
Print (LUN) (GetPageInfo = PTR.PAGEINFO.PRINTABLESIZE)
Gosub GetFuncResult ! Get low and high 16 bit results
PageWidth = LoResult ! Store resulting page width
PageHeight = HiResult ! Store resulting page height
Return
GetFuncResult:
Print (LUN) (GetFuncResult) ! Request result
Input (LUN) Result$ ! Input result
Word$ = SUB(Result$,2,1)+ Result$ ! Get and reverse 1st 2 bytes
LoResult = HEXDEC(Word$) ! Convert to numeric
Word$ = SUB(Result$,4,1)+SUB(Result$,3,1) ! Get and reverse 2nd 2 bytes
HiResult = HEXDEC(Word$) ! Convert to numeric
BigResult = HiResult*65536+LoResult ! Combined 32 bit numeric value
Return
|
| Example 2:
|
! Variables for GetFuncResult
Length 2 & Local Word$ ! Temporary 2 byte word holder
Length 4 & Local Result$ ! 4 byte string result
Length 5.0 & Local LoResult, HiResult ! Lower/upper 16 bit value
Length 10.0 & Local BigResult ! 32 bit value
! Variables for GetBkMode
Length 5.0 & Local PrevBkMode
! Program segment
.
.
Gosub GetBkMode
.
.
GetBkModeSize:
Print (GetBkMode)
Gosub GetFuncResult ! Get lresults
PrevBkMode = LoResult ! Store resulting mode
Return
GetFuncResult:
Print (LUN) (GetFuncResult) ! Request result
Input (LUN) Result$ ! Input result
Word$ = SUB(Result$,2,1)+ Result$ ! Get and reverse 1st 2 bytes
LoResult = HEXDEC(Word$) ! Convert to numeric
Word$ = SUB(Result$,4,1)+SUB(Result$,3,1) ! Get and reverse 2nd 2 bytes
HiResult = HEXDEC(Word$) ! Convert to numeric
BigResult = HiResult*65536+LoResult ! Combined 32 bit numeric value
Return
|