home *** CD-ROM | disk | FTP | other *** search
- HOW TO BEGIN IN GFA
-
- (Written by someone who really started from the bottom but is getting
- better very fast...)
- Hello,
-
- Bonus asked me to write a text for the DBA Diskmagazine 3. So I wrote
- a bit on programming. Bonus and K.G.E. ( the coders of this magazine)
- are trying to learn me how to program in GFA-Basic. It is not very
- difficult because the instructions are very simple, and GFA-Basic is
- very fast. Not as fast as ASM ofcourse but still for a Basic it is
- very fast.
-
- If you want to learn how to program you have to observe and remember!
- ( If you are not so good at remembering you may have to write it
- down! (could come in handy later! ( maybe! ))) As you probably know
- there are some small GFA programs in the DBA Diskmagazines. These are
- great help because they give you a good example of what GFA is capable
- of. And the explanation is very good.
-
- If you start programming don't start too difficult. You have to start
- with a simple concept, and make it more complicated later on.
- For example:
- '
- ' Small Gfa example (I)
- '
- x%=1 ! X-coordination.
- y%=1 ! Y-coordination.
- dx%=1 ! counter for x%
- dy%=1 ! counter for y%
- '
- ' Main program
- '
- REPEAT
- ADD x%,dx% ! count x% up with dx%
- ADD y%,dy% ! count y% up with dy%
- IF x%<1 OR x%>319 THEN ! check for not going out of screen.
- dx%=-dx% ! if dx%=1 then dx%=-1 and vice versa
- ENDIF
- IF y%<1 OR y%>199 THEN ! check for not going out of screen.
- dy%=-dy% ! same as dx% go and see there.
- ENDIF
- PLOT x%,y% ! show coordinations.
- UNTIL INKEY$<>"" ! if any key is pressed then
- EDIT ! go to editor.
-
- This is a simple example, but you can make it much more difficult,
- you could try to show only ten x-,and y-coordinations.
-
- '
- ' Small Gfa Example (II)
- '
- DIM x%(10),dx%(10),y%(10),dy%(10) ! create some variables.
- FOR i%=1 TO 10
- x%(i%)=i% ! give each x% a number.
- y%(i%)=i% ! give each y% a number.
- dx%(i%)=1 ! every x-counter=1
- dy%(i%)=1 ! every y-counter=1
- NEXT i%
- REPEAT
- FOR i%=1 TO 10
- ADD x%(i%),dx%(i%) ! count up x% with dx%
- ADD y%(i%),dy%(i%) ! count up y% with dy%
- IF x%(i%)<1 OR x%(i%)>319 THEN ! check if not out of screen.
- dx%(i%)=-dx%(i%) ! if dx%=1 then dx%=-1 and vice
- ENDIF ! versa.
- IF y%(i%)<1 OR y%(i%)>199 THEN ! same as above
- dy%(i%)=-dy%(i%)
- ENDIF
- PLOT x%(i%),y%(i%) ! show x and y
- NEXT i%
- CLS ! clear screen
- UNTIL INKEY$<>"" ! if any key is pressed then
- EDIT ! go to editor
-
- The program is a bit more complicated, but you can make it much more
- difficult just use your imagination.
-
- If you want to learn how to program then you try to gather (small)
- Gfa-sources, and you try to understand them. You experiment with them,
- and you compare it with other programs.
-
- As you see you don't have to make it very difficult.
-
- If you have questions or remarks you could write a lettre to:
-
- O.T.M.
- Rembrandtstraat 48
- 8331 RP Steenwijk
- The netherlands.
-
-
- Text by O.T.M. of Digital.
-
-
-
-
-
-
-
-
-
-