0660103030566 9[....................................................] € GFA takes parameters --------------------- Many programmers know how to read the command line passed to a .TTP program, or the document name of an installed GEM application is when it double clicked on. However, few people know how to do it in GFA BASIC - this month, Leighton Cathcart from Bangor, Co. Down in Northern Ireland comes to the rescue. "Accessing the command line is very easy as GFA BASIC contains a built-in variable called BASEPAGE, which holds the address of the basepage of your program. The command line string is stored 128 bytes further on from this address. The length of the command line string is stored at BASEPAGE+128 and the string starts at BASEPAGE+129, terminated by a zero. The folowing program is an example in which the command line is placed in the string ARG$. You should compile it and give it a .TTP extension". ------------------------------------------------------------------------------ A:\LISTINGS\GFA_TTP.BAS ------------------------------------------------------------------------------ Rem Read command line in GFA Rem By Leighton Cathcart Length%=Peek(Basepage+128) If Length%=0 Print"No command line" End Else For Count%=129 To (129+Length%) Char%=Peek(Basepage+Count%) Arg$=Arg$+Chr$(Char%) Next Count% Endif Print"Command line:";Arg$ Repeat Until Inkey$=Chr$(13) ------------------------------------------------------------------------------ "This will work not only for .TTP programs, but also for GEM .PRG programs as well. When you select Install Application from the desktop, the name of the file you opened to run your application is also placed at this location in memory." What a GFA dump! ---------------- Another GFA user is Giulio Marchesi from Bergamo in Italy. Giulio has provided a program in GFA BASIC V2 to produce better proportioned screen dumps for Degas Elite .PI3 pictures. The program was written for an Epson FX-800 9-pin printer, but it should work on all compatibles. ------------------------------------------------------------------------------ A:\LISTINGS\GFA_DUMP.BAS ------------------------------------------------------------------------------ Rem Degas PI3 screen dump Rem By Giulio Marchesi ' print Degas .PI3 INPUT "Filename: ";file$ BLOAD file$,XBIOS(2)-34 GOSUB print_degas ' PROCEDURE print_degas a$=SPACE$(800) ! buffer for line data g$=CHR$(27)+"*"+CHR$(1)+CHR$(800)+CHR$(800/256) ' FX 800 graphics mode, double density) OPEN "",#99,"LST:" ! open printer channel FOR s%=XBIOS(3) TO s%+79 ! reads screen data x%=VARPTR(a$) FOR q%=s%+399*80 TO s% STEP -80 FOR i%=0 TO 1 ! double data for double density POKE x%,PEEK(q%) INC x% NEXT i% NEXT q% PRINT #99,g$;a$;CHR$(13); ! one line and CR PRINT #99,CHR$(27);"J";CHR$(1); ! 1/216 line feed PRINT #99,g$;a$;CHR$(13); ! print line again PRINT #99,CHR$(27);"J";CHR$(23); ! 23/216 feed NEXT s% CLOSE #99 RETURN ------------------------------------------------------------------------------ STOS tip --------- Kevin Ware-Lane of High Wycombe, Buckinghamshire, has found an undocumented feature in STOS BASIC: "Create any file, and save it in the root directory of your working copy of the STOS Basic disk. It must be saved under the file name AUTOEXEC.BAS. Now, whenever you boot your working copy of STOS, that BASIC program will be loaded and run."