[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: A XyWrite Programming Preprocessor
- Subject: Re: A XyWrite Programming Preprocessor
- From: Carl Distefano cld@xxxxxxxx
- Date: Wed, 22 Apr 2009 23:47:49 -0400
Reply to note from "Kari Eveli" Wed, 22 Apr
2009 10:53:57 +0300
Kari:
> The XPL programming stuff mentioned here are great, and a bit
> overwhelming. My contribution is a tiny utility that I have
> developed for my own use back in the nineties. It's main
> purpose to make XPL programs more readable. Try it. It is
> documented and quite easy to use. Now available for downloading
> at:
>
> http://www.lexitec.fi/xywrite/compile.zip
Ah, I see. So you write a commented (but non-working) version of
your XPL program (following some simple rules), and COMPILE.R
changes it into working code. Nice idea, geared to XPL under Xy3+,
which, unlike Xy4, doesn't have a built-in comment symbol.
The downside -- and it's a big one for me -- is that you end up with
two versions of the program, the user-friendly one and the one that
really works. You could narrow the gap between the two by adding a
line to COMPILE.R that RUNs the "compiled" code after it removes the
comments -- in other words, turn it into an enhanced RUN command.
That would be value-added, from my point of view.
On balance, though, I think I prefer a technique that allows
comments to be added to working code. The trick is to find something
that allows comments to be read in non-eXPanded view without adding
a lot of baggage that slows down the program. I like Wally Bass's
strategy of using a simple IF statement ("1<0") that evaluates to
False, so that execution jumps to the next EndIf. Like this:
BC es 1XC ≪IF1<0~≫ Turn Error Suppression ON.............
More comments here, if you like...........................
≪EI~≫program continues here
It works. You get a clean display in draft view (not bad in eXPanded
view, either). There's a speed penalty, inevitably, but in short
routines it's negligible.
Anyway, nice job, Kari. COMPILE.R is worth checking out if you write
XPL for Xy3.
--
Carl Distefano
cld@xxxxxxxx