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

Re: BC XC or BX Q2



Reply to note from Morris Krok  Sun, 15 Oct
2000 09:35:04 -0700

-> when I replaced the BC XC with BX Q2, the program did not work.
-> Can anyone explain the reason for this quirk. Using BX Q2 is
-> suppose to be an improvement on the BC approach as it avoids
-> the command line.
->
-> BC seb /^/XC GT BC se .WA .XC >
-> NW CL BX spellQ2 ES GT CL @NW 
-> BF BD BD # 

Not "supposed to be", Morris. Is! However, the usage is different
from BC ...XC in one crucial respect. Everything that appears
between BX and Q2 is interpreted *literally*. And that means
*everything*, including functions. So the statement BC se .WA .XC
is very different from BX se .WA .Q2 . In the BC statement, func WA
is *executed*, producing the reverse-video-A wildcard, so that the
command searches for any alphanumeric character. In the BX
statement, func WA is treated as a *string literal*, with the result
that the command searches for -- and finds -- func WA itself. Try
it.

(This difference is hinted at, but far from documented, in
"Signature: Making the Transition", page 5-12 at Note #2, which
advises: "Searching for a carriage return with BX is different than
with BC. When you use BX, enter an actual carriage return...". BX
also accepts the reverse-video "wild" carriage return, produced by
executing func WC.)

-> Furthermore what is the command in Xy4 that saves the command
-> line and which can be inserted in a program. Is it the same or
-> similar to the one used by Herb Tyson in XyWrite Revealed?

Tyson's book reveals very little about saving and restoring the
command line. The rudimentary procedure is essentially the same in
Xy4, XyWin and NBWin as in Xy3: To save:
>>; to restore: BC . This will
restore plain-text commands, but not ones that include 3-byte
entities, such as functions or wildcards. For a comprehensive
routine that restores everything, see {{5cmline}} in XYWWWEB.U2,
which saves the CMline to Save/Get 616. (The usage is JM 2.cmlineQ2
to save; BC  to restore.)

The concepts needed to master this complicated subject are presented
in CTRLCHAR.TXT. It's the Urtext and Rosetta Stone of XyWrite
programming, required reading for the more-than-casual XPL
programmer. Put Tyson aside, Morris, and study CTRLCHAR.TXT!
You'll be rewarded many times.

On the other hand, if you use BX...Q2 consistently (and correctly),
you'll find that restoring the command line becomes a much less
pressing concern. Overweening attention to the command line is a
characteristic Xy3 obsession; decathect from Xy3, and the neurosis
will disappear.

Time's up for today.

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