home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_NEWS / STN_01_C.MSA / DATA_DOC24 < prev    next >
Text File  |  1994-03-14  |  6KB  |  132 lines

  1. üGFA BASIC TIPS & TRICKS Çby Richard Karsmakers
  2.  
  3. Originally  published in üST NEWSÇ Volume 1 Issue  6,  launched  on 
  4. November 15th 1986.
  5.  
  6. Most  people  already  know about the new GfA  Basic  that's  been 
  7. finished  recently:   Version  2.0.  It  contains  over  30  extra 
  8. commands,  which  will be discussed in a seperate article  in  the 
  9. next issue of üST NEWSÇ.  To obtain the newest version,  you'll have 
  10. to do the following (in Germany):  1) Send the original GfA  Basic 
  11. (old version) to: GfA Systemtechnik GmbH, Heerdter Sandberg 30, D-
  12. 4000  Düsseldorf  11  (telephone  0211/588011)  2)  Enclose   your 
  13. registration  card  (if you haven's sent it to  them  already)  3) 
  14. Enclose an envelope for the way back (C-5 size,  with air bubbles, 
  15. with  DM  2,50 stamps on it) 4) Enclose DM 20,- cash (this  is  to 
  16. cover  for  all  kinds of costs,  including the  36  pages  manual 
  17. extra).
  18.  
  19. I promised to have a chat about SETTIME, SPRITE, UPPER$, PSAVE and 
  20. GET/PUT this time, so I'll start right away.
  21.  
  22.  
  23. The SETTIME command has the following syntax:
  24.  
  25.                SETTIME timestring,datastring
  26.  
  27. This  command is really very simple to use.  You'll just  have  to 
  28. make sure that all data is entered with two digits.  So the  first 
  29. of Januari 1987 would be "01.01.1987".  The time is also given  in 
  30. two  digits each,  with which you have to watch out for PM  or  AM 
  31. times.  So 9 o' clock in the morning would be "09:00:00",  "09:00" 
  32. or "0900", whereas the '09' should be replaced by '21' if you mean
  33. 9 o' clock in the evening.  Note: when you enter the time, the ':' 
  34. and even the seconds can be left away,  whereas the date has to be 
  35. entered  with '.' as seperation.  When you enter a faulty date  or 
  36. time, they aren't changed.
  37. Now,  let's  go on to the SPRITE command (for which I  bet  you've 
  38. been waiting all the time!).  In the previous issue of üST NEWSÇ  we 
  39. published a program called "Pattern Editor",  from which you might 
  40. have guessed a bit about the SPRITE command already. The format is 
  41. as follows:
  42.                     SPRITE A$[,x,y]
  43.  
  44.  
  45. 'A$' can be another string expression if you want to,  of  course. 
  46. If  you  enter  SPRITE A$,  the sprite will be  removed  from  the 
  47. screen,  whereas  entering e.g.  SPRITE A$,100,100 will  put  your 
  48. sprite  on x-and y-position 100 and 100.  The action point of  the 
  49. sprite will then be located at those exact coördinates.
  50. The 'A$' is built up like this:
  51.  
  52.      A$=MKI$(x-coördinate of the action point)
  53.        +MKI$(y-coördinate of the action point)
  54.        +MKI$(0)   If this value is 0, the sprite will be displayed
  55.                   normally, if it is 1 it will be displayed XORed
  56.        +MKI$(mask color)   this will be 0 most of the time
  57.        +MKI$(sprite color) this will be 1 most of the time
  58.        +PAT$ (this is the bit pattern of the mask and the sprite)
  59.  
  60. The complete 'A$' can be made with the help of the Pattern  Editor 
  61. we published in the previous issue of üST NEWSÇ.
  62. Now, let's go on with the UPPER$ function. Actually, this function 
  63. will  not be used very often by most programmers,  but it  can  be 
  64. very useful in certain routines.
  65. The format is:
  66.                   UPPER$(string)
  67. This  function  converts all the alpha-characters of a  string  to 
  68. capitals,  including  occasional 'umlauts' (in German).  All  non-
  69. alpha-characters will be left unchanged.
  70. Examples:  "abcde" will be turned into "ABCDE"
  71.            "4574hf" will be turned into "4574HF"
  72. Two other GfA Basic commands,  GET and PUT will be talked about at 
  73. once.  These can be very useful in drawing programs,  as they  can 
  74. 'cut'  pieces  from screen memory and put them somewhere  else  in 
  75. screen memory (as you will be able to read in the next issue of üST 
  76. NEWSÇ,  these commands will also be added in a special version - to 
  77. move  pieces of normal memory quickly - in the new version of  GfA 
  78. Basic). Their formats are:
  79.                     GET x0,y0,x1,y1,A$
  80.                     PUT x0,y0,A$[,mode]
  81. With  the  GET  command,  x0 and y0 comprise  the  upper  lefthand 
  82. coördinates of the box that has to be put into A$ (here, again, A$ 
  83. can  be any other string expression),  whereas x1 and y1  are  the 
  84. coördinates of the lower righthand point of the box to be  stored. 
  85. Once A$ is GET,  you can later use the PUT command to put A$  back 
  86. on the screen again, on any spot you wish, where x0 and y0 are the 
  87. coördinates of the upper lefthand point where the box will be put. 
  88.  
  89. Of  course,  the other coördinates will not have to be  specified, 
  90. since the size of the box was already defined using GET.  The  PUT 
  91. command  also  enables the user to specify an  optional  parameter 
  92. ('mode').  This parameter determines the mode in which the box  is 
  93. put on screen. The values can range from 0 to 15:
  94. (S is the string, I is the image that was there before)
  95.      0    Erase
  96.      1    S and I
  97.      2    S and (not I)
  98.      3    S (overwrite)
  99.      4    (not S) and I
  100.      5    I (do nothing)
  101.      6    S xor I
  102.      7    S or I
  103.      8    not (S or I)
  104.      9    not (S xor I)
  105.     10    not I (invert)
  106.     11    S or (not I)
  107.     12    not S (reverse overwrite)
  108.     13    (not S) or I
  109.     14    not (S and I)
  110.     15    1
  111. Next time, I'll talk about the new GfA Basic commands in GfA Basic 
  112. V2.0, but here's already a sneak preview:
  113. The  run-only interpreter of the new version has been  changed  as 
  114. well.  It  is  now possible to execute the  run-only  interpreter, 
  115. after which it will immediately load the actual GfA Basic program. 
  116. This way,  you could call the Run-only interpreter "YOURFILE.PRG", 
  117. and  the GfA Basic file "YOURFILE.RSC".  This tends to  look  very 
  118. professional!
  119. Make sure to have a backup of the run-only interpreter before  you 
  120. enter this small program:
  121.  
  122. OPEN "U",#1,"YOURFILE.PRG"
  123. SEEK #1,30
  124. PRINT #1,CHR$(0);"YOURFILE.RSC"
  125. CLOSE #1
  126.  
  127. That's  all.  Thanks to Pim Coenradie (who received the  new  user 
  128. manual before I did) for telling me this;  he also used it in  his 
  129. program "Simple Draw".
  130.  
  131.  
  132.