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

Re: Strange SA/NV behavior--BK is culprit



Carl,
Ahhh. Yes, it does help. all makes sense now. I got the wrong IF/EI count because the CI command didn't pick up the one at the top of the file. Sometimes it misses those.

Good way to set $MO.
On the I got fooled between zero-relative and one-relative counting. Was thinking it would pick up stuff after a (here non-existent] second bracket.

Ill be up to speed on XPL . . . about a week after I'm dead.
BTW, nifty structured view on the IFEI frame! It seems that the guillemets it uses for the code are the 3-byte "nonactive" variety.
How come?
Reply to note from Harry Binswanger  Fri, 16 Oct 2009
12:47:28 -0700

Harry:

> Do you mind some questions about your code, from one seeking to
> learn?

Shoot.

> --what is the purpose of ? To me that reads as: do
> nothing.

It sets the file modification flag () to 1 -- without actually
modifying the file ("do nothing" is a Good Thing in this case).
Addresses the  bug referred to in your earlier post.

> --isn't there an extra  at the end? I count 11  and 12
> 

Nope. IFs and and EndIfs are balanced. (Tested with frame IFEI.)

> is the following a way of extracting what's after a "[":
> >?

Sort of. To be more precise, it extracts the 2nd "["-delimited segment
of the string in S/G 02. So if S/G 02 has "first[second[third[fourth",
 returns "second". If 02 has "[UNTITLED]",  returns
"UNTITLED]" and  returns "[UNTITLED". In the following
sequence, S/G 02 starts out with "[UNTITLED]" and ends up with
"UNTITLED" -- i.e., the brackets are removed:

;*; S/G 02 contains "[UNTITLED]"
>>;*; Parse out brackets
;*; S/G 02 contains, and PRompt displays, "UNTITLED"

> --where's the space for the SA Newname command?

Right after "{greater_than}0>".

> Hmmm, let me see if I have the overall logic right:

Basically, you have it. But note that [UNTITLED] is not the only
instance where the filename may contain square brackets. If you issue
SA against a secondary copy of an open file (file is open,
you CAll it again and answer "Y"es to the PRompt), the VA$FP is in
brackets, and VA$FI returns a close bracket at the end of the
filename. So those brackets are parsed out, too. There is a potential
gotcha here, because frame SA will let you save a second, filename-in-
brackets copy of a file to disk, whereas the native SA command will
force you to supply a filename. With frame SA, if you SAve a secondary
copy of a file and then go back and edit the primary (unbracketed)
copy of the file, you may inadvertently overwrite changes you made in
the secondary copy (what the native SA command seeks to protect
against). I may modify frame SA so that it doesn't SAve bracketed
filenames (other than [UNTITLED]), but just makes the backup copy of
those files.

> BTW, I forget what the backslash in the  does.

It displays the error *message* associated with the numeric error
*code* that follows. For example,  displays "Not enough disk
space for output." If S/G 01 contains the numeric value 559, then
 does the same. (ERR /NV lists all numeric error
codes and messages.)

Hope this helps.

--
Carl Distefano
cld@xxxxxxxx


Harry Binswanger
hb@xxxxxxxx