[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Magic Editor



Reply to note from MorrisKrok@xxxxxxxx Sun, 1 Apr 2001
14:21:04 EDT

> In order to edit a 100 screen page catalog that takes
> the format below, (that is to remove the code after
> the T code), I wrote the following program in Xy3
> version 3.57 which worked but it was tediously slow.
> Is there any way that I could have written it
> otherwise that would have speeded up the process.

Morris:
Your code contains several unnecessary instructions
which slow it down. No need to test for End Of File;
just SEarch for an uppercase "T" followed by a number,
and when the search fails -- you're done. (In programs
where you do need to test for EOF, avoid using a
procedure that requires inserting extraneous characters
in data. It imposes an unnecessary burden on the user,
leads to errors, and is therefore bad form. Xy4 has
system VAriables that test for TOF and EOF ( and
, respectively); in Xy3 you can do something like
>CR (>)>[continue].) Don't use two instructions where one will
do. DW RD (Define Word, Rub out Define) can be
shortened to RW (Rub out Word). Further, you can
eliminate NW by constructing your SEarch command so that
it leaves the cursor on the "Next Word". See the
attached code, which includes variants for Xy3 and Xy4.

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/


Attachment: mk010401.pm
Description: Binary data