ࡱ>  ܥhW e 5jjjjjjj  $C&(((FnLLgXv$j$jj<jj&<~jjjj&B J3/97-258 page 1 of 1 Subject: More Heat on Command-line Arguments Author: Jerry Wagener Date: 11 Nov 1997 Java does command-line arguments in a nice, easy-to-use, almost-intuitive way: class CommandLine // note: String is the Java character-string type { public static void main (String args[]) { . . . // args[0] is the value of the first command-line argument . . . // (space delimited), args[1] the second, etc. } // args.length is the number of arguments } // args[i].length() is the length of the ith argument The Fortran analogy would be: program CommandLine (args); character(*) args(:) . . . ! args(1) is the value of the first command-line argument . . . ! (space delimited), args(2) the second, etc. . . . ! size(args) is the number of arguments end ! len(args) is the length of the longest argument In the example execution a.out Las Vegas 143 size(args) would be 3, args(1) would have the value Las , args(2) the value Vegas, and args(3) the value 143 . To accommodate command-line arguments in Fortran in this manner, the program statement is extended to optionally include a dummy argument list with one dummy argument; that argument must be declared as a rank-one assumed-length deferred-shape character array. The corresponding actual argument is supplied by the system upon execution of the program and comprises the space-delimited command-line argument character strings. The size of the actual argument is the number of such arguments supplied, and the element length of the actual argument is (at least) that of the longest such argument supplied. /= 8FV%yDSy&-AH_k u U]acU]c]cUcc# G^qrsGYZxyDzijk !!!!!!!!!!!"!!!"!"!"!"!!!!!"!"!"!"!!!!!"!!!`8P!K@Normala "A@"Default Paragraph Font    V]?CW[&*+,LO^e+/XY]  /3NRB Rich MaineC:\My Documents\jlw.doc Rich MaineA:\97-258.wrd.doc@HP LaserJet 5/5M PostScriptLPT1:PSCRIPTHP LaserJet 5/5M PostScriptHP LaserJet 5/5M PostScriptw odXXd[pRdCustom page 1|CCCustom page 2|CCCustom page 3|CCHP LaserJet 5/5M PostScriptw odXXd[pRdCustom page 1|CCCustom page 2|CCCustom page 3|CCCTimes New Roman Symbol &Arial5Courier New"phZFZF_ZF $vNJava does command-line arguments in a nice, easy-to-use, almost-intuitive way: Rich Maine Rich Maine Root EntryFiles of typeP F@<WordDocument`5CompObjjSummaryInformationgG<@XAXAHA(,r(W}0G  FMicrosoft Word Document MSWordDocWord.Document.69qOh+'0$0@ T`    OJava does command-line arguments in a nice, easy-to-use, almost-intuitive way:P Rich MaineNormal Rich MaiDocumentSummaryInformation8 $՜.+,0HPdlt |  NASA-DFRCH  OJava does command-line arguments in a nice, easy-to-use, almost-intuitive way:ne2AMicrosoft Word for Windows 95@F#@~@Hk@Hk՜.+,0HPdlt |  NASA-DFRCH  OJava does command-line arguments in a nice, easy-to-use, almost-intuitive way: