home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / 11910 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.4 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!unido!sbsvax!sbustd!tobl
  2. From: tobl@sbustd.rz.uni-sb.de (Tobias Blickle)
  3. Newsgroups: comp.sys.atari.st
  4. Subject: Re: Passing parameters?????? 8^)
  5. Message-ID: <20430@sbsvax.cs.uni-sb.de>
  6. Date: 31 Jul 92 06:21:34 GMT
  7. References: <1992Jul28.114232.3549@arizona.edu>
  8. Sender: news@sbsvax.cs.uni-sb.de
  9. Distribution: world,local
  10. Organization: Studenten-Mail, Rechenzentrum Universitaet des Saarlandes
  11. Lines: 41
  12.  
  13. Ok, so there seems to be nobody to answer, I'll post my solution
  14. to the problem, passing a commandline-sting to a GFA-Basic program.
  15. It's really quite short:
  16.  
  17.  
  18. ------------------------------CUT HERE-----------------------------------
  19. ' Demonstration for passing a command line
  20. ' string to (compiled) GFA-Basic-programm
  21. ' Tobias Blickle
  22. '
  23.  
  24. GOSUB get_cmd(cmd$)
  25. writeln("Commandline is:"+cmd$)
  26. END
  27. '
  28. PROCEDURE get_cmd(VAR a$)       !reads commandline from basepage
  29.   a$=""
  30.   IF PEEK(BASEPAGE+128)<>0
  31.     a$=CHAR{BASEPAGE+129}       !That's the point!
  32.   ENDIF
  33. RETURN
  34. '
  35. PROCEDURE write(was$)           !same as PRINT, but redirectable output
  36.   ~GEMDOS(9,L:V:was$)
  37. RETURN
  38. '
  39. PROCEDURE writeln(was$)         !WRITE+LF+CR
  40.   write(was$)
  41.   ~GEMDOS(2,10)
  42.   ~GEMDOS(2,13)
  43. RETURN
  44.  
  45. ----------------------------CUT HERE-------------------------------------
  46.  
  47. The procedures WRITE and WRITELN I use, to get an redirectable output
  48. when using a shell. The original PRINT-command is not redirectable.
  49.  
  50.  
  51. Bye
  52.  
  53. Tobias
  54.