(1) TSE comes with a grep.s macro from Semware. The
alternate grep discussed here also exists in a file
called grep.s. so the names will collide. For now,
rename TSE's original grep file to
grep.org, or some
other name of your choice. If you want to continue to
use both, you'll need to rename one or the other. I
primarily use this alternate, so I've renamed the TSE
original to tsegrep.s.
(2) Download the following files from the "old" Semware web
site:
(3) Inside your TSE installation mac directory, create a
directory "grep". Move the zip files from (2) into that
directory.
cdd f:\wordproc\tse32_v44200\macdownlo\
md grep
copy grep3230.zip grep
copy dlg222.zip grep
copy dlg222p.zip grep
copy gethlp40.zip grep
(4) Inside the grep directory, unzip the following:
cd grep
pkunzipc -extract -dir grep3230.zip
pkunzipc -extract -dir dlg222.zip
pkunzipc -extract -dir gethlp40.zip
Warning for duplicates, rename e.g. to the name of the current package
09/04/2002 01:20 4.041 dialogDUPLICATEDLG222.si
21/04/2005 01:22 363 file_idDUPLICATEDLG222.diz
19/05/2002 17:32 353 FILE_IDDUPLICATEGETHLP40.DIZ
19/05/2002 14:56 1.205 guiincDUPLICATEGETHLP40.inc
Delete the .mac files packaged with these zip files:
del *.mac /s
(5) Make the following file name changes. This is necessary
because Linux is case-sensitive, while Windows is not.
ren GETHELP.K32 gethelp.k32
(6) Edit dialog.s, and find the following line. At the time
I'm writing this, the line is 227:
String Paint[] = "DialogP" // name of paint module
Change to:
String Paint[] = "dialogp" // name of paint module
(7) Create an executable file called build.bat with the
following contents. The dashes below are delimiters
here; do not include them in build.sh:
First create a subdirectory, as I do not want these
files copied to my main mac directory, as this is
only testing.
md DDD
move *.* DDD
del *.*
copy build.bat DDD
cd DDD
This is the content of build.bat:
-----------------
sc32 dialog.s
sc32 grep.s
REM
copy *.mac ..
copy grep.hlp ..
-----------------
If using Linux:
For the curious, the command lines define -dWIN32=0 because
various macro files include a test checking for this
define. Running this macro under Linux requires the same
sections of code, so the easiest workaround is to just
create the define at compile time.
After creating this file, make it executable with the
following command:
If using Linux:
chmod +x build.sh
Now run it:
build.bat
Here there was an error:
--- cut here: begin --------------------------------------------------
File: F:\WORDPROC\tse32_v44200\MACDOWNLO\grep\DDD\dialog.s
Compiling............................................................
Error 2335 (1333,22) Undefined symbol 'DlgMsgText' encountered
SAL Compiler V4.50 (bcc version)
Copyright 1991-2021 SemWare Corp. All rights reserved worldwide.
--- cut here: end ----------------------------------------------------
Solution:
add at the top of the dialog.s file this text, save and recompile.
STRING DlgMsgText[255] = ""
---
Pay attention to the printed messages, looking for reported
errors. If you do not see any errors, then the macro and
help files should be ready to use. Verify with a directory
listing of the mac directory. You should see the followng
files with recent dates:
cd ..
dir grep.hlp
dir dialog.mac
dir dialogp.mac
dir gethelp.mac
dir grep.mac
(8) To test, open up a text file in the editor. From the
main menu, select Macro - Execute, and then enter grep
into the Execute macro: prompt. You should see a popup
dialog box with Grep in the title, and a list of Search
and Grep options on the bottom.
If you want to use this version of grep, you will want to
modify your UI file to assign a key combination to execute
it.