GFA BASIC TIPS & TRICKS by Richard Karsmakers
Originally published in ST NEWS Volume 1 Issue 6, launched on
November 15th 1986.
Most people already know about the new GfA Basic that's been
finished recently: Version 2.0. It contains over 30 extra
commands, which will be discussed in a seperate article in the
next issue of ST NEWS. To obtain the newest version, you'll have
to do the following (in Germany): 1) Send the original GfA Basic
(old version) to: GfA Systemtechnik GmbH, Heerdter Sandberg 30, D-
4000 Düsseldorf 11 (telephone 0211/588011) 2) Enclose your
registration card (if you haven's sent it to them already) 3)
Enclose an envelope for the way back (C-5 size, with air bubbles,
with DM 2,50 stamps on it) 4) Enclose DM 20,- cash (this is to
cover for all kinds of costs, including the 36 pages manual
extra).
I promised to have a chat about SETTIME, SPRITE, UPPER$, PSAVE and
GET/PUT this time, so I'll start right away.
The SETTIME command has the following syntax:
SETTIME timestring,datastring
This command is really very simple to use. You'll just have to
make sure that all data is entered with two digits. So the first
of Januari 1987 would be "01.01.1987". The time is also given in
two digits each, with which you have to watch out for PM or AM
times. So 9 o' clock in the morning would be "09:00:00", "09:00"
or "0900", whereas the '09' should be replaced by '21' if you mean
9 o' clock in the evening. Note: when you enter the time, the ':'
and even the seconds can be left away, whereas the date has to be
entered with '.' as seperation. When you enter a faulty date or
time, they aren't changed.
Now, let's go on to the SPRITE command (for which I bet you've
been waiting all the time!). In the previous issue of ST NEWS we
published a program called "Pattern Editor", from which you might
have guessed a bit about the SPRITE command already. The format is
as follows:
SPRITE A$[,x,y]
'A$' can be another string expression if you want to, of course.
If you enter SPRITE A$, the sprite will be removed from the
screen, whereas entering e.g. SPRITE A$,100,100 will put your
sprite on x-and y-position 100 and 100. The action point of the
sprite will then be located at those exact coördinates.
The 'A$' is built up like this:
A$=MKI$(x-coördinate of the action point)
+MKI$(y-coördinate of the action point)
+MKI$(0) If this value is 0, the sprite will be displayed
normally, if it is 1 it will be displayed XORed
+MKI$(mask color) this will be 0 most of the time
+MKI$(sprite color) this will be 1 most of the time
+PAT$ (this is the bit pattern of the mask and the sprite)
The complete 'A$' can be made with the help of the Pattern Editor
we published in the previous issue of ST NEWS.
Now, let's go on with the UPPER$ function. Actually, this function
will not be used very often by most programmers, but it can be
very useful in certain routines.
The format is:
UPPER$(string)
This function converts all the alpha-characters of a string to
capitals, including occasional 'umlauts' (in German). All non-
alpha-characters will be left unchanged.
Examples: "abcde" will be turned into "ABCDE"
"4574hf" will be turned into "4574HF"
Two other GfA Basic commands, GET and PUT will be talked about at
once. These can be very useful in drawing programs, as they can
'cut' pieces from screen memory and put them somewhere else in
screen memory (as you will be able to read in the next issue of ST
NEWS, these commands will also be added in a special version - to
move pieces of normal memory quickly - in the new version of GfA
Basic). Their formats are:
GET x0,y0,x1,y1,A$
PUT x0,y0,A$[,mode]
With the GET command, x0 and y0 comprise the upper lefthand
coördinates of the box that has to be put into A$ (here, again, A$
can be any other string expression), whereas x1 and y1 are the
coördinates of the lower righthand point of the box to be stored.
Once A$ is GET, you can later use the PUT command to put A$ back
on the screen again, on any spot you wish, where x0 and y0 are the
coördinates of the upper lefthand point where the box will be put.
Of course, the other coördinates will not have to be specified,
since the size of the box was already defined using GET. The PUT
command also enables the user to specify an optional parameter
('mode'). This parameter determines the mode in which the box is
put on screen. The values can range from 0 to 15:
(S is the string, I is the image that was there before)
0 Erase
1 S and I
2 S and (not I)
3 S (overwrite)
4 (not S) and I
5 I (do nothing)
6 S xor I
7 S or I
8 not (S or I)
9 not (S xor I)
10 not I (invert)
11 S or (not I)
12 not S (reverse overwrite)
13 (not S) or I
14 not (S and I)
15 1
Next time, I'll talk about the new GfA Basic commands in GfA Basic
V2.0, but here's already a sneak preview:
The run-only interpreter of the new version has been changed as
well. It is now possible to execute the run-only interpreter,
after which it will immediately load the actual GfA Basic program.
This way, you could call the Run-only interpreter "YOURFILE.PRG",
and the GfA Basic file "YOURFILE.RSC". This tends to look very
professional!
Make sure to have a backup of the run-only interpreter before you
enter this small program:
OPEN "U",#1,"YOURFILE.PRG"
SEEK #1,30
PRINT #1,CHR$(0);"YOURFILE.RSC"
CLOSE #1
That's all. Thanks to Pim Coenradie (who received the new user
manual before I did) for telling me this; he also used it in his
program "Simple Draw".
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.