Article View: comp.sys.atari.st
Article #33821Re: Fsfirst/Fsnext question
From: Barnacle Wes
Date: Sun, 28 Aug 1988 04:54
Date: Sun, 28 Aug 1988 04:54
44 lines
1667 bytes
1667 bytes
In article <566@laura.UUCP>, klute%trillian.irb@unido.uucp
(Rainer Klute) writes:
> does anyone know about a 'legal' way to do something like this:
Sure, make your code look like:
Routine_A: Routine_B:
========== ==========
DTA *save, my_dta;
save = Fgetdta();
Fsetdta(my_dta);
.
Fsfirst (...);
Fsnext ();
.
Call_Routine_B ();
. DTA *save, local_dta;
. save = Fgetdta();
. Fsetdta(local_dta);
. .
. Fsfirst (...);
. Fsnext ();
. .
. Fsetdta(save);
. return;
.
Fsnext();
Fsetdta(save);
return;
In general, it is a good idea to always work with your own DTA. You can
even use this to advantage in different routines, as long as you are
careful to restore the previous DTA before returning.
CAVEAT: I wrote this off the top of my head, without consulting ANY
manuals at all. The intent is correct, but I am sure the code wouldn't
compile and run at all. Look up the calling sequence for Fsetdta and
Fgetdta CAREFULLY before trying this.
--
{hpda, uwmcsd1}!sp7040!obie!wes
"Happiness lies in being priviledged to work hard for
long hours in doing whatever you think is worth doing."
-- Robert A. Heinlein --
Technical Details
Message-ID:
<174@obie.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!utah-gr!uplherc!sp7040!obie!wesReferences:
<566@laura.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!utah-gr!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.sys.atari.st Subject: Re: Fsfirst/Fsnext question Summary: Sure, just save/restore the DTA Message-ID: <174@obie.UUCP> Date: 28 Aug 88 04:54:08 GMT References: <566@laura.UUCP> Organization: the Well of Souls Lines: 44