home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 3
/
PDCD_3.iso
/
pocketbk
/
utilsf
/
hypoc2
/
BROWSE.OPL
< prev
next >
Wrap
Text File
|
1994-07-06
|
3KB
|
84 lines
app hyperpoc
enda
rem ---------------------------------
proc browse%:(par$)
rem ---------------------------------
rem
rem browse% displays all cards of the specified stack.
rem Pressing ESC or a hot key will abort browse.
rem Any other key will stop at the current card displayed.
rem par$ indicates the stack to be used:
rem "c" for the current stack
rem other for stack selection via dialog box
rem handles for card
global cdHand&,cardnum%,stack$(128)
rem variables
local r%,c%,oldStk$(128),oldCd%
rem remember current card
oldStk$ = curStk$
oldCd% = cuCd%
r% = -1
stack$ = curStk$
if par$ <> "c"
rem ask stackname with current stack as default
stack$ = curStk$
lock on
dinit tx$:(165) : rem "Browse"
dfile stack$,tx$:(129),16
r% = dialog
lock off
endif
if r%
onerr err1 : rem Define error handler
rem The browsing is actually implemented as onIdle: routine
rem We simply ask for a key press while switching
rem animation(1) and music(2) off but enabling the onIdle: routine(8).
c% = getKey%:(11)
rem Return to HyperPoc displaying the old card
if c% = 27 or c% >= 512
showCd%:(oldStk$,oldCd%)
endif
bye::
busy off
warning:(tx$:(166),0) : rem "Browsing finished"
return c%
rem
rem Error handler : Return error code to hyperpoc
rem
err1::
onerr off
return err
endif
endp
rem onIdle: searchs for the next card and displays it.
rem The routine is called continously. When no more
rem cards are found, onIdle returns the code for the
rem ESC key which is then returned via getKey%:.
proc onIdle:
busy tx$:(167) : rem "Browsing"
cardnum% = findCd%:(stack$,1,"",addr(cdHand&))
if cardnum% = 0 : return 27 : endif
showCd%:(stack$,cardnum%)
endp
rem edParm$: supports the editing process for browse objects.
proc edParm$:(parm$)
local p%
if parm$ = "c"
p% = 1
else
p% = 2
endif
dinit tx$:(165) : rem "Browse"
dchoice p%,tx$:(129),tx$:(168) : rem "Stack" "current,as selected"
dialog
if p% = 1
return "c"
endif
endp