home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 10: Diskmags / nf_archive_10.iso / MAGS / ST_NEWS / STN_02_4.MSA / DATA_DOC21 < prev    next >
Text File  |  1987-06-11  |  3KB  |  109 lines

  1. üGFA BASIC TIPS & TRICKS Çby Richard Karsmakers
  2.  
  3. Since there haven't been much problems lately, you'll notice that 
  4. this article isn't really big this time.  But those that actually 
  5. occured weren't too difficult to answer.
  6.  
  7. The problems that reached me in this issue were:
  8.  
  9. 1)  How do I make sure that an item selector box doesn't  destroy 
  10. my whole screen when activated in low res?
  11.  
  12. Answer:  The only way to do this, is to buffer the screen and put 
  13. it  back on the proper place again after the fileselector is  de-
  14. activated. Thus:
  15.  
  16.  Sget Buffer$
  17.  Fileselect "*.*","",Load$
  18.  Sput Buffer$
  19.  
  20.  
  21.  
  22.  
  23. 2)  I  use several screens in my program,  located  on  different 
  24. locations  in  memory.  I  swap  between  them  using  the  XBIOS 
  25. function number 5. But now and then, my screens get messed up and 
  26. menu bars that I use are scrambled after switching.  What must  I 
  27. do?
  28.  
  29. Answer:  Your  program probably uses the same space as  that  are 
  30. used  by  GfA  Basic to store variables,  or  to  buffer  certain 
  31. operations. This can be avoided by starting your program with the 
  32. following line:
  33.  
  34.  Reserve 150000
  35.  
  36. In most cases,  this line leaves enough space (150 Kb) for Basic. 
  37. If not, just increase or decrease the number.
  38.  
  39. 3)  How  do I calculate length of a string that  will  contain  a 
  40. piece of the screen taken by GET, before it is taken?
  41.  
  42. Typing in the following program (on the next page) will give  the 
  43. result. The coördinates are specified by the variables X1, Y1, X2 
  44. and Y2. The last line is included to check the accuracy.
  45.  X%=Xbios(4)       !Get res
  46.  If X%=0           !Low res
  47.    X=4             !4 bit planes
  48.  Endif
  49.  If X%=1           !Med res
  50.    X=2             !2 bit planes
  51.  Else              !High res
  52.    X=1             !1 bit plane
  53.  Endif
  54.  X1=0              !Coordinates are here (can vary)
  55.  Y1=0
  56.  X2=1
  57.  Y2=79
  58.  U=((Y2-Y1)+1)*X*(2*((Int((X2-X1)/16))+1))+6
  59.  Print U
  60.  Get X1,Y1,X2,Y2,A$
  61.  Print Len(A$)
  62.  
  63. 4)  Is  there a way to make files readable again that  are  saved 
  64. with the help of the 'PSAVE' command?
  65.  
  66.  
  67. Answer: Yes, there is! It is quite a complicated thing to do, ans 
  68. I  was  just trying to find it out (together with  Frank  Lemmen) 
  69. when  an  acquaintance of mine had me copy one of  his  PD  disks 
  70. containing a "PSAVE REVERSE" program. The listing is contained on 
  71. this üST NEWSÇ disk, contained in the folder "PROGRAMS".
  72.  
  73. 5)  How do use the ST Basic (uugh!) command LPRINT USING  in  GfA 
  74. Basic?
  75.  
  76. Answer:  Since I do not have a printer myself,  I am not sure the 
  77. solution  I give will be full-proof.  But I think you'll have  to 
  78. add one of the lines
  79.  
  80.     OPEN "O",#1,"LST:"    !For Centronics
  81.     OPEN "O",#1,"AUX:"    !For RS232
  82.  
  83. before you start printing.  The actual printing would have to  be 
  84. replaced by
  85.  
  86.     PRINT #1,USING............(etc.)
  87.  
  88.  
  89. After printing,  you'll need to close the channel again by adding 
  90. the line
  91.  
  92.     CLOSE #1
  93.  
  94.  
  95. There also were some problems that I could not solve.  Maybe you, 
  96. our reader, can help out.
  97.  
  98. 1) How do I perform communication with modem or such in GfA?
  99.                                 R. Bitter
  100.  
  101. 2) How do I change the shape of the cursor (not the mousecursor)?
  102.                                 G.A.J. van Oene
  103.  
  104.  
  105. That  was it for today!  I only hope someone will find an  answer 
  106. some  time to my VDIBASE problem (see the "Questions  &  Answers" 
  107. column of this issue)!
  108.  
  109.