Contrary to Per's comments, I am most grateful to the many people
who
have posted helpful advice regarding my recent BASIC problems in
transferring some programs which I wrote many years ago from an
Aurora,
SGC, QuBide machine to QPC2 on my PCs. I am still investigating the
disappearance of EXTRAS loaded from my BOOT program - a situation
which
only occurs in QPC2 (not on the Aurora machines). The offered
solutions
to my query about being able to step through the program are, as
has
been noted on this list, very slow and time consuming but I have
attempted them in the hopes of identifying the error(s). In
hindsight,
what I had in mind, was something more along the lines of the
"trace"
facility found in PSION Archive and Xchange (archive) which I use
extensively. From advice offered by contributors on this list, I am
currently checking the full list of EXTRAS at various points in the
program to see if the missing ones all disappear together or a few
at a
time at various points. I may well have a few VERY BASIC questions
regarding the use of EXTRAS to do this, later today. Having said
all
this, I have to accept that the programs concerned do work well
(the
first time round) and it is only on the occasion when having closed
a
program I need to use it again that I find that without a full
power-down and reBOOT the programs will not run due to missing
extensions. I thought that once loaded (LRESPRd), toolkits etc
remained
loaded until the machine was powered-down. Do I have this BASIC
premise
correct?
Thank you all for your help and guidance.
Regards,
John Gilpin.
I had a look at John's boot program but lack of time prevents me from
taking a very detailed look.
Basically, his program revolves around code like:
Get_Value_Of_Loaded%
IF NOT loaded% THEN
LRESPR various extensions
END IF
He checks the value of loaded% by sending the output of EXTRAS to a
file, then reading it in line by line until he finds the Q_Liberator
extension "Q_L", something like
loaded%=0
rep loop
input #chan%,extn$
IF extn$='Q_L' THEN loaded%=1 EXIT loop
end rep loop
(all this from memory, not from his code, but the gist of it is there)
The idea behind IF NOT loaded% THEN of course is to allow the boot
program to do its other work without attempting to install extensions
twice. This isn't something I'd normally do in my programs, I'd split
the boot into two, the first installing the extensions, then chaining
a second one to do the other work, so the second program could run
without having to deal with the extensions issue.
A simple change to check for anything going wrong with a particular
extension or set of extensions is to change which extension namke he
looks for, or even check for an extension in each of the dozen or so
toolkits he loads to see if one toolkit in particular is causing the
problem, adding temporary test lines like:
3230 INPUT #chan%,extn$
3231 IF extn$ = "...." THEN PRINT"This extension loaded"
3232 IF extn$ = "...." THEN PRINT "That extension loaded"
and so on. A bit clumsy, but should help to isolate which extensions
exactly are going missing.
With a fairly long and complex boot program like this it is probably
better to revert to first principles and isolate the part causing the
error, i.e. loaded% is expected to be 1 on the second run, if not, why
not?
With such a complex boot program, better to write a second version as
a test rig and just include the bits of code which are going wrong. A
snag while testing was that he installs a dozen or so files with
LRESPR, and I only have about 7 of those, meaning I couldn't fully
test it out to rule out all possibilities.
The reason why John got the specific error message at line 210 of his
program is simply that MENU_REXT checks if it is being installed
twice. But that doesn't of course explain why the "Q_L" extension is
not being found when he looks for it, unless it's something to do with
the order of QLiberator files being installed or something like that.
Anyone looking at his program, check line 3170 where he sends the
EXTRAS to a file, then opens that file for reading without closing it,
which runs the risk of the file not being fully flushed:
3170 EXTRAS #chan%
3180 OPEN_IN #chan%,"ram1_load_extns"
(better to add a CLOSE #chan% to line 3170, or even wind the file
position pointer back to 0 without the OPEN_IN.
(Just trying to save someone a bit of work when they take a detailed
look at the program)
Dilwyn Jones
P.S. Congratulations John, the new white Quanta mag envelopes got
through the post without being damaged ... the first for months not to
be damaged in post!
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm