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

Re: Intervening Prompt



Reply to note from Morris Krok  Thu, 18 Jan 2001
17:25:57 -0800

-> Changing my file from Ca (call) to Read has erased the
-> intervening prompt. However, I still cannot use the BX, Q2
-> operatives.

That's because your code, Morris, has a latent bug that only becomes
operative when BC XC is changed to BX Q2 .

Consider the following line from your program:

DL YD AS BC XC GT XP 

Based on your private explanation, I understand that the line of text
that's DeFined with func DL and assigned to Save/Get 06 consists of a
CAll command followed by a d:\path\filename, thus:

ca c:\xyfind\aboutme.txt

Note that func DL DeFines not only the line, but the final *carriage
return* as well. When you put the contents of Save/Get 06 on the
command-line with BC , the carriage return is put there as well
and causes the command to be *executed*. (Putting a carriage return on
the command line in XPL is the same as hitting the Enter key -- it
executes the command.) This happens before the func XC instruction is
ever reached. And when func XC *is* reached, it executes "ca
c:\xyfind\aboutme.txt" a second time. I doubt very much that this is
what you intended; but, on the command-line it is nevertheless a
"legal" (doable) operation.

Now, when you change BC XC to BX Q2 , you are no longer
using the command line as your workspace. Rather, you are instructing
XyWrite to execute a command in memory. On the command line, as we
saw, a carriage return operates like hitting the Enter key -- it
executes the command. In memory, however, that carriage return is just
another two characters (Ascii-13 and Ascii-10) which are tacked on to
the end of the filename; and that's what causes the error. In the case
of "ca c:\xyfind\aboutme.txt", the two extra characters are added to
the extension .txt, in effect creating an illegal (in DOS) long
filename; the result is error 585 ("Too many letters in file name").
But if your intended command were, say, "ca c:\xyfind\aboutme.t", then
the two extra characters (13+10), although within the 3-character limit
for .EXTensions, are nevertheless illegal filename characters, and the
result is error 226 ("DOS error").

In a word, the culprit is that func DL. What you need, instead, is
something that DeFines the line but not the final carriage return,
i.e., LB DF LE DF . (If you want the cursor to end up on the first
character of the next line, add func CR .) Substitute those functions
for DL in your routine, and it will work with both BC..XC and BX..Q2 .

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