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

Re: A primitive programming question



Reply to note from Peregrine@xxxxxxxx Wed, 23 Feb 2000 00:22:54 EST

-> I wrote a small program that runs something like this:
->
-> UC ... then it repeats ad infinitum ... for a
-> couple of screens ... What I want to do is shorten the actual
-> program file by inserting a command (or series of them) that
-> "loops" the sequence to the end of the file.

Jeff:

What you need is a GoLabel command which instructs the program to loop
back to a point marked by a LaBel statement, thus:

UC

When execution reaches  (Goto Label "a"), it loops back to 
(LaBel "a"). (I've reversed your funcs XC and NW, on the assumption
that the cursor starts out on the first letter of the first word to be
upper-cased.)

Note that the above code will continue executing ad infinitum until
interrupted by a BreaK command. It would be much better to build some
intelligence into the program so that it stops processing at the end of
the list. Xy4 has a variable  that reports whether the cursor is
at the End of File; in Xy3 you have to improvise. One technique is to
record cursor position, execute a Cursor Right (func CR), then test
whether the cursor has advanced. If it hasn't, you're at the end of the
file (so stop executing). Otherwise, replace the cursor (func CL) and
keep processing. For this we use another important pair of programming
commands,  and  (End If):

UC>">">


Here's the actual code (Base64-encoded):

--=_BASE64.PM_(XyWWWeb.U2)_v1.0
MIME-Version: 1.0
Content-Type: application/octet-stream; name="20000223.POP"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="20000223.POP"

/4EfdWOuTEJhr/+BCf+Ap65TWDAxLK5DUK+v/4BjrklGrkNQrz6uUFYwMa+v/4BbrkdMYa+u
RUmvrlBSRG9uZa+uRVivDQo=

--=_BASE64.PM_(XyWWWeb.U2)_v1.0


I hope this helps.

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