[Date Prev][Date Next][Subject Prev][Subject Next][
Date Index][
Subject Index]
Re: Re-opening files
- Subject: Re: Re-opening files
- From: OkAnnie@xxxxxxxx
- Date: Fri, 20 Oct 1995 17:45:54 -0400
"I thought that I would be switching to the log/restore feature
that was added to Xy4, but I find that so far I still prefer my
homegrown concoction.
[...] I originally had the program itself linked to STARTUP.INT,
but decided to separate them, so that I could easily run RESTART
at any later time as well." --Wolfgang Bechstein
Wolfgang: If you consider imitation a compliment, consider
yourself complimented.
I lumped all shutdown/startup stuff into a single file named !!!
some time ago when I wrote code that at shutdown records which
subdir is active in each logical partition and the active drive
letter to @F, and stsgt's old.!kh. Of course at startup !!!
ldsgt's old.!kh, and all things being equal each subdir and the
drive are reactivated. I always avoided the issue of reopening
the file(s) I was working on at end of session till your
interesting msg inspired me.
My startup.int does two things only: searches a file my
autoexec.bat generates (if trouble found quits xyW; else kills
file), and--using a unique argument--calls !!!. !!! configures or
reconfigures xyW according to what was happening at the end of
the last session and which cartridge hdd is loaded at startup, or
any time !!! receives certain args (for specialized work--QXP,
html, C--.kbds, .hlps, etc.), plus it has all file and session
shutdown stuff.
The shutdown part borrows the Leading Edge Word Processor's
key concept
(could as easily be ^Q): If I hit with a file open and
confirm with XC, the file is stored. With no file open, ...
XC ends the session; if a file is unexpectedly open in another
window, !!! displays it and exits (if I've forgotten it I probably
need to inspect it). Over time I've gilded
LEWP's lily: ... CC with file open: (do .exe that)
saves file with no eof.
... with file open: aborts.
... with no file open in active window: closes
window.
... <-> in all circumstances: shells to dos.
I've resisted the temptation to overdecorate ( ...
is *not* close and print file, etc.). Any other key after
produced no action till I thought about your msg. Now ...
... <*> with a file open in any window assumes that the
intent is to preserve the file(s)-open state for the next
session. It uses save/gets @1-@9
(I never ever use @0-@9, or have even as many as five windows
open). !!! cycles through all open files--displays each, records
cursor position and path\name to the @ that corresponds to
windows #1-#9, issues a BC sa ???
(with a clear or execute prompt) {rc}, and aborts. Then the
session shuts down as always. Whether or not @1-@9 are used, !!!
must initialize them all to prep for startup: If !!! finds then
that the size of any is >0 and the content is an existing file,
!!! opens it in the window where it was before and jmp's to the
cursor position recorded in the same @. !!! remove's @1-@9;
old.!kh stays. They are the only files involved (v3 !!!=4366 bytes / v4=4433
/ old.!kh=375 just now). If I decide at startup to do something
else, aborting the open files is simple enough. To restart, I'd
run !!! with the same arg that startup.int sends it. Or I could
code in, say, an r arg so a BC run !!! r XC would skip everything
except the startup @1-@9 stuff. ...
"That's it. As they say, I don't know 'bout you, but it works for
me."
Thanks for the energizing msg, Wolfgang. No doubt any number of
v3 session-saving xpl utilities are floating around. I know
without looking that
Carl's and Robert's are elegant. After I finished mine I
consulted the oracle and found that this time I didn't reinvent
Tyson's wheel (like you, he saved the info to a disk file). I
remembered a save-all-open-files-and-quit sequence in Art
Campbell's v3 alphabetical reference. Who should the author be
but ... Tim Baehr , who started this topic longer ago than I'd
have given him credit for if I hadn't found QUITSAVE in
Campbell's Programs appendix. ;) ... In case it's of interest to
anyone, I'm including the !!!
@1-@9 sections (xyDos 3- and 4-compatible; plus code to protect
@1-@9 from unwanted overwrites) below, PKZIP'd and XXBUG'd. --A
========================== annie fisher nyc
Save text between dotted lines as down_up.scr ... With debug.exe
subdir in path statement, at the system prompt type and execute:
debug < down_up.scr
----------------------------->CUT
HERE<-----------------------------
NDOWN_UP.ZIP
E100 FC BB 03 00 BF D4 01 BE CC 01 33 C9 AD 86 CC AA FE C0 E2 FB
4B
E115 75 F5 B9 FF FD BA 20 02 52 B4 3F CD 21 5F 72 60 8B F7 50 8B
C8
E12A B0 2A F2 AE 75 55 B0 0D F2 AE 87 F7 BB 00 01 B2 04 AC 3C 2A
72
E13F 62 74 46 57 BF D2 01 B9 40 00 8A E1 F2 AE 5F 75 35 FE C1 2A
E1
E154 88 27 43 FE CA 75 E0 56 BE 00 01 AD 86 C4 8B D0 AD 86 C4 5E
B1
E169 02 D2 E0 D3 E0 D2 E2 D3 EA D0 E1 D1 EA D1 D8 E2 FA 86 C2 AA
8A
E17E C4 AA 8A C2 AA EB B1 BF 20 02 58 33 D2 F7 D8 13 D2 F7 DA 33
DB
E193 8B CA 8B D0 B8 01 42 CD 21 8B 0E CA 01 CC AC 3C 0A 75 FB AC
57
E1A8 BF D2 01 B9 40 00 8A E1 F2 AE 5F 75 D0 FE C1 2A E1 86 E0 32
E4
E1BD 8B 1E CA 01 03 D8 89 1E CA 01 E9 6C FF 00 00 30 0A 41 1A 61
1A
E1D2 2B 2D
G=100
W220
Q GXDPlus 1.0
*XXBUG20--00000584--20101995--A4C19FA5------------------DOWN_UP.Z
IP
nI2g1--E++++6+3ZLJ-x+8Ljt2UI++4wB+++6++++6IFDJotTJJ0BZgxiqoMEVwxl
s-Tc
ndFiYU4qMQYpFzt5MXdnO0CdvLG-+ENAfWNJ2AhmJ7FQ66DMByV-3Pxl5uO4DIDGO
Jq-b
nNZTGGd22+w78d9tN1aRbtXT3vRojjaEw1hLVkHj7l4+WkqEOCmnegHWFUmXigoUk
6NCA
nVmm7aFwzAS2zwizvL96fhr9JRZWEV7lZD2WmI9+YtH5fFGDCMbzA-FW297VY6gZM
acV6
nFf07H3OaKQN3agEVDUbiHuAM5-1ghJhtrINXVyUP-nT7S0lNa2KDb9Pp+sYzlSEV
X19-
nSj06IR8D+byY6Q40HeLT6JN6oNTUrGUwSnIQb95XbrWIVKMnQ7lby7sDDD+b+avo
a-lk
nBjKTK0yAl70ZTWP7RsX0y6YBkZ0QbFkS5-sIRxp3-+glOnKQsh5zPWeI8e9SQN2y
hVfe
nt6qfmjlPw95ALlEwkch0k1xCaPwgtoDuT31Zz9DaqqVu7O9TXch6hBL7mQKtoblP
kM47
nsIklr2PH9NhiqLFf0xqouONBBvTE1Nhiq5FX0pqruPdBpvTEBNiiqLFh0yrNh4TH
rVOu
nOhBJauticJqPRarOJL0wGBB-XHAyHW-Ph-JXZtSLtTkzTJJkqD7BdQ92C64mMJ5A
NYzj
n2w2wm3wz41uhvhEkPHvoq3AmMK2G5oZ44NSNWw1D69gTYcZYos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M
gntq
nz30bu4QQ29zt5p-9+E6I+-E++++6+3ZLJ-x+8Ljt2UI++4wB+++6++++++++++++
6+++
X+++++++VF2xLHZxJI3-9-EM++++++E+-+1M++++s-E+++++B
*XXBUG Version 2.21 by Chad Wagner
----------------------------->CUT
HERE<-----------------------------