home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / bbs / ff810.lha / FF810 / Amiga_E / Sources / Examples / ReadArgs.e < prev    next >
Text File  |  1993-01-24  |  530b  |  18 lines

  1. /* Use readargs() to get parameters instead of using the string 'arg'.
  2.    This is more convenient if more than one arg is needed. Uses kick 2.0 */
  3.  
  4. OPT OSVERSION=37
  5.  
  6. PROC main()
  7.   DEF myargs:PTR TO LONG,rdargs
  8.   myargs:=[0,0,0]
  9.   IF rdargs:=ReadArgs('UNIT/N,DISK/A,NEW/S',myargs,NIL)
  10.     WriteF('UNIT=\d\n',Long(myargs[0]))      /* integer */
  11.     WriteF('DISK=\s\n',myargs[1])            /* string */
  12.     WriteF('NEW=\d\n',myargs[2])             /* boolean */
  13.     FreeArgs(rdargs)
  14.   ELSE
  15.     WriteF('Bad Args!\n')
  16.   ENDIF
  17. ENDPROC
  18.