home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
prgramer
/
rexx
/
rdebug
/
rdbhelp.kex
< prev
next >
Wrap
Text File
|
1993-03-25
|
5KB
|
185 lines
/*H* RDBHELP.KEX 02-10-93 12:19*/
Arg dborigin .
parse arg . item menu menu? .
parse arg . key
signal on error; signal ON FAILURE; signal on halt
signal ON NOVALUE;
signal ON NOTREADY;
signal ON SYNTAX
dbme='rdbHELP'
Parse Value 'COMMAND SET!COMMAND X!COMMAND EXT' With dbcs'!'dbxx'!'dbce
Parse Value 'COMMAND!COMMAND COMMAND SOS' With dbc'!'dbso
dbce '/FN/OPSYS'
dbsys=opsys.1
if dbsys='OS/2' then dbsys='OS2' /*O*/
Parse Value 0 0 With dbvar dbtrc dbtrap dbtrapp dbmsg
call initial
select
when dborigin='HELP' then call db1panel menu''item
when dborigin='/PANEL' then call db1panel menu''item
when dborigin='/HYPERTEXT' then call db3panel 0 key
when dborigin='/HYPERTEXT2' then call db3hypertext2
when dborigin='/TEST' Then do
/* to test hypertext links
dborigin= '/HYPERTEXT'
call db3panel 0 key; end
to test type: def c-f5 rdbhelp '/TEST'
*/
dborigin='/PANEL'
call db1panel; end
otherwise call db1panel menu''item
end
dbc 'MSGM ON'
if dbtrc=-7 then return -7 dbtrap
Exit dbvar
DB1PANEL:
arg panel
if menu? then parse value db3panel('/PANEL' panel) with dbtrc dbtrap
else do
if command() then parse value db3panel('/PANEL HT') with dbtrc dbtrap
else call process_word_at_cursor
end
If dbmsg<>'' Then 'EMSG' dbmsg
if dbtrc=-7 then return -7 dbtrap
return 0
PROCESS_WORD_AT_CURSOR:
dbce '/curline'
i=pos(keyleft,curline.3)
if i>0 then do
j=pos(keyright,curline.3)
if j>i then do
key=substr(curline.3,i+1,j-i-1)
parse value rdbhelp('/HYPERTEXT' key) with dbtrc dbtrap
return; end
end
parse value rhypertx('/RDEBUG') with dbtrc dbtrap
parse value dbtrc dbtrap with key dbfound
if dbtrc=-7 then return -7 dbtrap
if dbfound=0 then parse value db3hypertext2('/HYPERTEXT2' key) with dbtrc dbtrap
else dbvar=1 key
return
DB3HYPERTEXT2:
arg . panel
'3'
dbcs 'RESER -1 REVERSE rDEBUG ESC=Exit PGUP=Last Page PGDN=Next Page Arrow Keys=Select'
call process_file
if dbtrc=-7 then return -7 dbtrap
return 0
db3PANEL:
arg . panel
if panel='KEDIT' then help='KEDIT.HLP'
else if panel='REXX' then help='\RDEBUG\REXX.HLP'
else help='RDBHELP.HLP'
dbxx help
dbc ':0 ALL'
dbcs 'SHAD OFF'
dbcs 'MSGM OFF'
if help='RDBHELP.HLP' then dbc 'V 5'
if dborigin='/HYPERTEXT' then do
if help='RDBHELP.HLP' then do
signal off error
dbc '/_'panel
signal on error
dbce '/curline'
panel=strip(substr(curline.3,1,4))
i=pos('_',panel)
if i>0 then panel=substr(panel,1,i-1)
key=strip(substr(curline.3,5))
dbc 'ALL /'panel'_ '
signal off error
dbc 'TAG /'hypertext
signal on error
call delete_other_systems
end
else key=panel
end
else do
if help='RDBHELP.HLP' then do
dbc '/'panel'_'
dbce '/curline'
dbc 'ALL /'panel'_ '
call delete_other_systems
signal off error
dbc 'TAG /'hypertext
'+3'
signal on error
key=strip(substr(curline.3,5))
end
else key=panel
end
dbcs 'RESER -1 REVERSE rDEBUG ESC=Return PGUP=Last Screen PGDN=Next Screen F1=Select'
call process_file
if dbtrc=-7 then return -7 dbtrap
return 0
PROCESS_FILE:
dbcs 'RESER 1 WHITE ON BLUE' center('Help:' key,80)
dbfn= time('s')
dbc 'FN' dbfn
dbce '/FILEID'
dbcs 'TOFEOF OFF'
'REFRESH'
do forever until (readv.1=esc)+(readv.1=goback)>0
dbc 'READV KEY'
select
When readv.1=pgup then dbc 'BA'
When readv.1=pgdn then dbc 'FO'
When readv.1='CURL' then dbso 'CL'
When readv.1='CURR' then dbso 'CR'
When readv.1='CURU' then dbso 'CU'
When readv.1='CURD' then dbso 'CD'
When readv.1='F1' then do
parse value rdbhelp('/PANEL') with dbtrc dbtrap;
if dbtrc=-7 then leave
end
otherwise nop
end
end
dbxx fileid.1
'QQUIT'
':'line.1
dbcs 'msgmode' msgmode.1
if dbtrc=-7 then return -7 dbtrap
return 0
DELETE_OTHER_SYSTEMS:
if dbsys<>'OS2' then dbc 'LESS /*O*/'
return 0
INITIAL:
if menu?='' then menu?=0
if menu='' then menu='F'
parse value 0 with dbtrc dbtrapp dbmsg panel
dbce '/FN/FT/LINE/MSGMODE'
readv.1=''
esc='ESC'
goback='F3'
panel=''
pgup='PGUP'
pgdn='PGDN'
keyblank=' '
keyleft=''
keyright=''
hypertext=keyleft'~'keyright
if dbsys='CMS' then dbs=' '
else dbs='.'
if dbtrc=-7 then return -7 dbtrap
return
ERROR: return db9trap(sigl 80e) sourceline(sigl)
FAILURE: return db9trap(sigl 80f) sourceline(sigl)
HALT: return db9trap(sigl 80h)
NOTREADY: return db9trap(sigl 80r) sourceline(sigl)
NOVALUE: return db9trap(sigl 80v)
SYNTAX: return db9trap(sigl 80e) errortext(rc)'~'sourceline(sigl)
db9TRAP:
if dbtrc=-7 then dbtrapp=dbtrap
parse arg dbsigl dbtcode dbtrest
dbtrap = 0 dbme dbsigl dbtcode dbmsg rdbmsg(dbtcode dbme dbsigl) dbtrest
dbtrc=-7
return -7 dbtrapp'~'dbtrap