-
Notifications
You must be signed in to change notification settings - Fork 2
/
rxhelp.kex
186 lines (170 loc) · 8.88 KB
/
rxhelp.kex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */
/* Usage: [MACRO] RXHELP [topic] */
/* Purpose: Replacement for the 1991 RXHELP.KEX, which only */
/* supported REXX/Personal with RXHELP.REX. For */
/* context sensitive help in REXX sources assign */
/* RXHELP.KEX to an editor key. */
/* Proposal: file extension(s) key C-H key F1 */
/* *.CMD *.REX *.CLS khelp rxhelp */
/* *.KML *.KEX rxhelp khelp */
/* *.C *.H *.CPP *.HPP khelp ktags */
/* otherwise ktags khelp */
/* :F1 */
/* if arg() then 'khelp' arg(1) /* compatible F1 key */ */
/* else 'macro C-H khelp ktags rxhelp' */
/* :C-H */
/* if arg() then do /* MACRO C-H called: */ */
/* parse arg F1 . /* default 1st word */ */
/* if wordpos( ft.1(), 'C H CPP HPP' ) > 0 */
/* then parse arg . F1 . /* C-Help: 2nd word */ */
/* if wordpos( ft.1(), 'CMD REX CLS' ) > 0 */
/* then parse arg . . F1 /* RxHelp: 3rd word */ */
/* if wordpos( ft.1(), 'KML KEX' ) > 0 */
/* then F1 = F1 focusword.1() /* KEX: khelp topic */ */
/* 'synex' F1 /* optional synonyms */ */
/* else /* do opposite of F1 */ */
/* if wordpos( ft.1(), 'KML KEX' ) = 0 */
/* then 'macro C-H ktags khelp khelp' */
/* else 'macro rxhelp' /* KEX: macro rxhelp */ */
/* History: ooREXX 3.2 HTML books added 2008 */
/* RXHELP3.KEX is a backup of the version for 3.2, */
/* URL: <http://purl.net/xyzzy/kex/kexxsamp.zip> */
/* Updated 2010: ooREXX 4.01 HTML books added 2010 */
/* Get the ooREXX HTML books, store them anywhere, */
/* and fix the URLs in procedure OOREXX below for */
/* your box. W2K start file:///somewhere#fragment */
/* does not work, RxHelp uses BROWSER = 'FIREFOX' */
/* in these cases. Replace FIREFOX by the browser */
/* normally used to 'start' URLs, e.g., IEXPLORE. */
/* Updated 2012: KeditW 1.6.1 returns full names in opsys.1(), */
/* e.g., "WINDOWS 7" instead of "WINDOWS". This */
/* script assumes that opsys.2() = 7 is only used */
/* for DOS, this will fail miserably for Win NT 7. */
/* Updated 2017: Clearer ooRexx 6.0.4 reference manual entries. */
/* Updated 2020: Added ooRexx 4.2 chapter 11 condition keywords, */
/* fixed lookup of :: and . topics (no operators). */
/* Requires: HELPMSG.EXE if running under OS/2 or MDOS */
/* DOSREXX.INF if running under PC DOS 7.x */
/* ooREXX 4.2.0 HTML if running under NT or NTVDM, */
/* with "startable" file:///some/file.htm#fragment */
/* URLs on Windows NT, see procedure BROWSE below. */
/* Requires: Kedit 5.0 or KeditW 1.x (Frank Ellermann, 2020) */
TOPIC = space( arg( 1 )) ; VER = 20 /* OS/2 2.x */
if TOPIC = '' & command() = 0 then TOPIC = focusword.1()
if opsys.1() = 'DOS' | abbrev( opsys.1(), 'WINDOWS' )
then VER = word( opsys.2(), 1 ) /* NT, DOS */
if VER = 20 then 'dosq helpmsg rexx' TOPIC
else if VER <> 7 then rc = OOREXX( TOPIC ) /* NT DOS 5 */
else if TOPIC = '' then 'dosq view dosrexx' /* PC DOS 7 */
else 'dosq help rexx' TOPIC /* PC DOS 7 */
exit rc
OOREXX: procedure /* -------------------------- */
arg TOPIC ; parse source . . SRC
URL = 'file:///C:/etc/bin/Rexx/ooREXX%204.2.0/rexxref/'
T = 'Abbrev Abs Address Arg B2x Beep Bitand Bitor'
T = T 'Bitxor C2d C2x Center Changestr Charin Charout'
T = T 'Chars Compare Condition Copies Countstr D2c D2x'
T = T 'Datatype Date Delstr Delword Digits Directory'
T = T 'Endlocal Errortext Filespec Form Format Fuzz'
T = T 'Insert Lastpos Left Length Linein Lineout Lines'
T = T 'Lower Max Min Overlay Pos Qualify Queued Random'
T = T 'Reverse Right Rxfuncadd Rxfuncdrop Rxfuncquery'
T = T 'Rxqueue Setlocal Sign Sourceline Space Stream'
T = T 'Strip Substr Subword Symbol Time Trace Translate'
T = T 'Trunc Upper Userid Value Var Verify Word'
T = T 'Wordindex Wordlength Wordpos Words X2b X2c X2d'
T = T 'Xrange'
N = wordpos( TOPIC, translate( T ))
if N = 1
then return BROWSE( URL || 'xbuiltin.html#bifAbbrev' )
if N > 1
then return BROWSE( URL || 'bif' || word( T, N ) || '.html' )
T = 'Rxmessagebox Rxwinexec Sysaddrexxmacro Sysbootdrive'
T = T 'Sysclearrexxmacrospace Syscloseeventsem'
T = T 'Sysclosemutexsem Syscls Syscreateeventsem'
T = T 'Syscreatemutexsem Syscreatepipe Syscurpos'
T = T 'Syscurstate Sysdriveinfo Sysdrivemap Sysdropfuncs'
T = T 'Sysdroprexxmacro Sysdumpvariables Sysfilecopy'
T = T 'Sysfiledelete Sysfileexists Sysfilemove'
T = T 'Sysfilesearch Sysfilesystemtype Sysfiletree'
T = T 'Sysfork Sysfromunicode Sysgeterrortext'
T = T 'Sysgetfiledatetime Sysgetkey Sysgetmessage'
T = T 'Sysgetmessagex Sysini Sysisfile'
T = T 'Sysisfilecompressed Sysisfiledirectory'
T = T 'Sysisfileencrypted Sysisfilelink'
T = T 'Sysisfilenotcontentindexed Sysisfileoffline'
T = T 'Sysisfilesparse Sysisfiletemporary Syslinver'
T = T 'Sysloadfuncs Sysloadrexxmacrospace Sysmkdir'
T = T 'Sysopeneventsem Sysopenmutexsem Sysposteventsem'
T = T 'Syspulseeventsem Sysqueryprocess'
T = T 'Sysqueryrexxmacro Sysreleasemutexsem'
T = T 'Sysreorderrexxmacro Sysrequestmutexsem'
T = T 'Sysreseteventsem Sysrmdir Syssaverexxmacrospace'
T = T 'Syssearchpath Syssetfiledatetime Syssetpriority'
T = T 'Sysshutdownsystem Syssleep Sysstemcopy'
T = T 'Sysstemdelete Syssteminsert Sysstemsort'
T = T 'Sysswitchsession Syssystemdirectory'
T = T 'Systempfilename Systextscreenread'
T = T 'Systextscreensize Systounicode Sysutilversion'
T = T 'Sysversion Sysvolumelabel Syswait'
T = T 'Syswaiteventsem Syswaitnamedpipe Syswindecryptfile'
T = T 'Syswinencryptfile Syswingetdefaultprinter'
T = T 'Syswingetprinters Syswinsetdefaultprinter'
T = T 'Syswinver'
N = wordpos( TOPIC, translate( T ))
if N > 1
then return BROWSE( URL || 'utl' || word( T, N ) || '.html' )
T = 'Address Arg Call Do Drop Exit Expose Forward'
T = T 'Guard If Interpret Iterate Leave Loop Nop'
T = T 'Numeric Options Parse Procedure Pull Push'
T = T 'Queue Raise Reply Return Say Select Signal'
T = T 'Trace Use'
N = wordpos( TOPIC, translate( T ))
if N = 1
then return BROWSE( URL || 'instrc.html#keyAddress' )
if N > 1
then return BROWSE( URL || 'key' || word( T, N ) || '.html' )
T = 'ANY ERROR FAILURE HALT LOSTDIGITS NOMETHOD NOSTRING'
T = T 'NOTREADY NOVALUE ON OFF SYNTAX USER'
N = wordpos( TOPIC, translate( T ))
if N > 0 then return BROWSE( URL || 'condtra.html' )
T.1 = '::ATTRIBUTE dire.html#attrd'
T.2 = '::CLASS clasdi.html'
T.3 = '::CONSTANT constantd.html'
T.4 = '::METHOD methd.html'
T.5 = '::OPTIONS optionsd.html'
T.6 = '::REQUIRES requ.html'
T.7 = '::ROUTINE routd.html'
T.8 = '.CONTEXT contexte.html'
T.9 = '.ENDOFLINE oneof.html#ENDOFLINE'
T.10 = '.ENVIRONMENT oneof.html#envo'
T.11 = '.ERROR erobj.html'
T.12 = '.FALSE oneof.html#FALSE'
T.13 = '.INPUT inputt.html'
T.14 = '.LINE linee.html'
T.15 = '.LOCAL locenv.html'
T.16 = '.METHODS methe.html'
T.17 = '.NIL oneof.html#nil'
T.18 = '.OUTPUT outp.html'
T.19 = '.ROUTINES routinee.html'
T.20 = '.RS rs.html'
T.21 = '.TRUE oneof.html#TRUE'
T.22 = '.STDERR errorobj.html'
T.23 = '.STDIN stdinobj.html'
T.24 = '.STDOUT stdoutobj.html'
T.25 = '.STDQUE stdqueobj.html'
T.26 = 'RC spvard.html'
T.27 = 'RESULT spvard.html'
T.28 = 'SELF spvard.html'
T.29 = 'SIGL spvard.html'
T.30 = 'SUPER spvard.html'
do N = 1 to 30
if TOPIC = word( T.N, 1 )
then return BROWSE( URL || word( T.N, 2 ))
end N
if TOPIC <= '@' then return BROWSE( URL || 'ix01.html' )
'emsg' SRC 'knows no "' || TOPIC || '" for' URL
return 4
BROWSE: procedure
parse arg URL ; say 'start' URL
'dosq start' URL ; return rc