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

Timed Loops in XPL



To Tim and All:

1) Re numerical $DT switches for CAll, NEw, etc.: What a choice
morsel! Many thanks for sharing that!

2) I happened to look again at BIRDIE.PM, the silly bit of XPL I
sent in response to your "competition". What it does, BTW, is to
send a little birdie flying across the status line in Xy4 or
XyWin. Various other critters follow -- swimming, slithering and
otherwise locomoting across the screen. As I said, totally
useless. One interesting thing it does do, however, is to let
the user determine -- via a command line switch -- how long this
ridiculous display will continue until it's replaced by the
closing message "Fin". (In keeping with the pretentious
cinematic content,I added "titles" in French. Don't know any
Swedish.)

Anyway, the ability to keep a loop going for a specified length
of time struck me as possibly useful in more conventional
contexts and, in any event, as interesting. Note that what I'm
talking about here is not just a variant on the native "pause"
command, BX (p[ n]), which simply leaves the system as it was
immediately after the preceding statement was executed. Here we
take the pause command a step further by allowing something to
happen repeatedly during the "pause". Furthermore, there's
nothing to prevent the repeating loop from performing multiple
operations in quick succession (e.g., display a prompt, then
execute a function or command or any other XPL statement, or a
series thereof). In a word, XPL (however primitively) emulating
simultaneous processes or "multitasking"!

To illustrate the idea, I developed a demo program called
TIMELOOP.PM. In its default operation, TIMELOOP displays elapsed
time on the status line. This display "scrolls" (i.e., is
continuously updated, odometer- style) for as long as the user
specifies or 10 seconds by default. The SUbroutine that performs
this function is a "User
Variable" -- meaning that, by rewriting the SUbroutine, anyone
can substitute a different function altogether. TIMELOOP is thus
reusable
XPL -- except that, off the cuff, I can't think of any real-life
applications. Not yet, anyway. Can you?

Here's TIMELOOP.PM (XXencoded):

begin 644 timeloop.pm
hfYRAMOyiIpMkAGmjfZBKA16gfutHJX+n98yiIpMkB0mjfZBKA1IgfutHIn+g
hIpcxAH7EJ0lJFXpHJ23CF23GF0lAHHok937BDH+gI3QxC1J2GGlDFXok91Eg
hGJ+xA0kk91+gHYcgG3YxA0lEH1omBnBAGGkmBnBAGGkmBnBAGGl4F1omBnBA
hGGlII1ok927IDH0jfZJHA8wB0Uo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