home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vhelp.zip
/
VIEWHELP.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-08-25
|
2KB
|
79 lines
/* REXX */
/*
Procedure to allow VIEW'ing of .HLP files under OS/2 2.x
This procedure requires that VIEW.EXE be located in a
directory which is in your PATH statement. It works by
changing the 4th byte of the .HLP file from x'10' to
x'01', thus fooling OS/2 into thinking it is a .INF file.
This version of the procedure works by directly modifying
the .HLP file in question.
(c) Copyright 1994 FreeLance Programming. All rights reserved.
I can be contacted at: wcdw@delphi.com
- or -
1052 Utterback Store Road
Great Falls, VA 22066
This code (which comes with no warranties, either expressed
or implied), is hereby placed in the public domain. Enjoy! */
infchar = '01'x
hlpchar = '10'x
call RXFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
parse arg filename
filename = strip(filename)
if filename = '' then
do
say 'Usage is: VIEWHELP <filename>'
say ' '
say ' Where <filename> = The name of the .HLP file to be viewed. The'
say ' .HLP extension is assumed if it is not entered'
return
end
if translate(right(filename, 4)) <> '.HLP' then
filename = filename || '.hlp'
fullname = stream(filename, 'c', 'query exists')
if fullname = '' then
do
say 'The file ' || filename || ' could not be found!'
return
end
result = stream(fullname, 'c', 'open write')
if left(result, 5) <> 'READY' then
do
say 'Error (' || result || ') opening file ' || fullname || '!'
return
end
left = charout(fullname, infchar, 4)
clsd = stream(fullname, 'c', close)
'VIEW.EXE ' || fullname
/* The following (_really_ crude) do..until continually tries to reset */
/* the file to its original state. While VIEW is running, the stream */
/* command will return "NOTREADY:32", so this procedure just loops until */
/* that is not true. This may be revised in a future version, if I */
/* find a better wait to detect when VIEW has finished executing. */
do until left(result, 3) <> 'NOT'
call SysSleep 1
result = stream(fullname, 'c', 'open write')
end
fpos = charout(fullname, hlpchar, 4)
clsd = stream(fullname, 'c', 'close')
return