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

Sorting subdirectories, undocumented goodies



I'm still puzzled that I never noticed that XyWrite doesn't sort
subdirectories for use in the menus. I guess I've been pretty
consistent in using the DIR command and navigating from there
(for opening files or CD-ing to other directories). But there
is a roundabout way to sort subdirectories. Most defrag
software allows you to sort files and directories as part of the
defragmentation operation. If you defrag regularly (you do,
don't you, just like you always back up frequently?), you can
sort the directories at that time.

Here are a couple of undocumented (so far as I can tell) goodies.
1. I've been playing with the APFIL and RPLFIL commands. APFIL
sends command-line text or the contents of a Save/Get to a file
without opening the file. If the text already exists, in some
cases APFIL will replace it with new information. RPLFIL
modifies (replaces) text in a file and returns an error (with
beep) if the text isn't found.

APFIL/s filename,text[s]text

/s is a switch that usually includes some sort of divider; [s] is
the optional divider.

APFIL/= PROGMAN.INI,EditLevel=4

...will change the EditLevel number from whatever it was to 4.
If the line didn't exist, it will be put at the end of the file

RPLFIL/= PROGMAN.INI,EditLevel=4 will change the editlevel to 4,
but only if the line already exists; otherwise, you get an
error.

APFIL PERS.SPL,foobar

...will put the word 'foobar' at the end of the PERS.SPL file,
along with a carriage return.

APFIL PERS.SPL

...will put a carriage return at the end of PERS.SPL.

Be careful in experimenting with these commands -- they're a
little quirky and unintuitive.

BTW, the XPL version can use variables, like BX apfil≪pv01≫
≪pv02≫,≪pv03≫≪pv04≫≪pv05≫ Q2 where 01=/plus separator,
02=filename, 03=text, 04=separator, 05=change text.

2. You can CAll, EDit, REad, NEw a file and determine its view
mode from the command line.
CA/4 filename ... opens filename in WYSIWYG view
ED/2 filename ... opens filename in page/line view
NE/12 ... creates an untitled file in WYSIWYG no-marker view.
RE/100 filename ... opens filename in expanded view
The numbers (except 100) represent the view numbers in XyWrite.
100 is Expanded view because for some reason XyWrite doesn't
like the /0 switch.  Basics are 100 (Expanded), 1 (draft), 2
(Page/Line), 4 (WYSIWYG).  These switches work from the command
line, the menus, and from within XPL code.
I've put the basics (100,1,2,4) into radio buttons and the code
for my version of the Open dialog box, with the default button
being my XyWrite default (I use 1 -- draft mode). I don't use
the buttons often, but they come in handy when I need them.
Mostly I just use the command line and a switch (I have some
non-XyWrite text files that must be opened in expanded view
because they use the chevrons as quotation marks). I don't have
a chart of the more esoteric numbers, but you can figure them
out by changing to the view you want (the menus are really best
for this -- use the View Menu, set the basic view you want, then
go back to View and select Show/Hide Markers). Then on the
command line, type VA/NV $DT. You need the '$' to force XyWrite
to give you inf ormation about the current file and not the
default (most other settings are the opposite -- $ for default
and plain for current). The number of the view mode will show
up on the prompt line.

Have fun experimenting!

Cheers, T.