GFA BASIC TIPS & TRICKS by Richard Karsmakers
In this time's issue of ST NEWS I have again the honour of
solving some GfA Basic problems. Please also refer to the article
about "Undocumented System Variables" for more GfA Basic Tips &
Tricks!
Mr. Veldhuizen from Velp reacted to the fact that I seemed to
have used a much too difficult way to solve a problem in the
previous issue. The problem was that the LPRINT USING command
didn't quite work in GfA Basic asit would in ST Basic. According
to Mr. Veldhuizen, the solution is very simple. Let's take the
practical example of
Lprint Using A$,A%
by which information with regard to A% is contained in A$. For
example, A$ would be "Variable A%:###.#". In GfA Basic, Mr.
Veldhuizen solves the problem like this:
A$="Variable A%:"
LPRINT A$;
LPRINT USING ###.#,A%
You see? The lines with OPEN and CLOSE and the kind that I used
in the previous issue can now be left away.
Now the actual questions:
1) how do I make the length of a file on disk smaller? For
example I have made a random file with 20 items, and I want to
delete the last two. Can't this be done by simple making the file
shorter so that the last two are 'forgotten'? I hereby mean the
length that is given by the Gemdos function &H4E.
Answer: Whenever a file is created on disk, it is not only
written into the directory, but some bytes of the FAT are changed
as well. The FAT (File Allocation Table) actually tells the
operating system WHERE a file is located on disk (since it need
not be contiguous blocks). Changing the file length in the
directory is really dead-simple, but changing it on the FAT is
really difficult. It is even so difficult that it's not useful
anymore to shorten a file this way. Just load it and save it
again, would be my advice.
2) I have problems with flashing graphics when moving the mouse
and creating a cross on the place where the mousecursor is with
help of the GRAPHMODE command. What must I do to prevent this?
Answer: This is no problem that can be solved just like that. I
would advice you to use two screens (using Xbios function 5),
where you'll have to draw the graphics on the screen that is not
visible. Switching screens can cause good animation this way. You
can also try using the VSYNC command.
Disclaimer
The text of the articles is identical to the originals like they appeared
in old ST NEWS issues. Please take into consideration that the author(s)
was (were) a lot younger and less responsible back then. So bad jokes,
bad English, youthful arrogance, insults, bravura, over-crediting and
tastelessness should be taken with at least a grain of salt. Any contact
and/or payment information, as well as deadlines/release dates of any
kind should be regarded as outdated. Due to the fact that these pages are
not actually contained in an Atari executable here, references to scroll
texts, featured demo screens and hidden articles may also be irrelevant.