ÿWPC3 €hrv=c!lî<$™ðåÒîXE<Nb2¶¿ÂÉØ¹±LêÀD¶ÁçÕóN¬­'L¶u±—©Æïç ‹GÄGÙ\v­ãˆ>ù›¼JGÕ—N`º£TÏÞRh~&VwÄ‡ÓÐtêù-,s¼CEÅæóèØë ´W—PëëÖ»ÓþŠ‹îcnøÓbvðóø§Ÿ÷'|N¢·GO/g7î;öм{'4 ¤å O𣡫¢æ¹þ.Õ|,Tú|Õহ›r‡ï7B§Ïߥε¨ùÖuæÌò‚„sïy±6ƒ‘Ò Ù“c/áÿ­¦›Æ²nì*EûfS9Ыf¯+FvÍŒ°(ÂÚ_9ÃÖ*øiîñ±(dŒ‹5~©GW‡’exq™Vµ·——× Å³þ9…+¼¶wea¸ItÝfadáCÁzó7ù}‚‹@ÈÛZùìM î¾áL lX^n0[:qà Ž÷Ó¼ sˆÁy4´|kWň¾'}2 »QÔGðI™Ž<×Õö€tC2Ë ’ñÄ+ç ä™tüC«žhqæÝ‘è,œW¸îÖ_t¼ÌÜÊ‘BÁê£CÆì8:åѨm£>:nÅ[ÃËXä)h«¼ ç[ŠLÔœ[Ÿr´<—ð 0ú‡ # ‡‡’ %¢ 0û¨£ 0߫РmŒ‹£ 0û.e )UP3w@ƒ4ÃÃU)L×× ################## 0û)) D3$ BWWWWW Btttttttt AO‘‘‘Æàà 0D¦ D/êêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêêê CCommand Line Arguments and Environment Variables Ì  . ' 97-10a$Craig T. Dedo$0Craig T. Dedo .    Ý ƒò5'ÝÒ(°ÒÒ(°ÒÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÓ  ÓÝ  Ýò òà€ii,°"àISO/IEC€€JTC1/SC22/WG5-òòN1242ó óóóˆÐ À Ðà€œœ=°"àò òÔ€¼lè¼ôô¬?ÔX3J3€/€97¢„110ó óˆÐ Û ÐÔ‡ô¬?ô¼¼lèÔX3J3€ANSI€Fortran€Standards€Committeeà€mm=°"àCraig€T.€DedoˆÐ å% ÐCommand€Line€Arguments€&€Environment€Variablesà€]]:°"àJanuary€10,€1997ˆÐ ¬ì Ðà€JJJ°"àPage€Ú  Ú1Ú  Ú€of€6Ô#†¼lè¼ôô¬?W#Ô(Ò2ò5$§§Ý ƒ µ>!ÝÒ(°ÒÒ(°ÒÑÀ°ÑÑÀ°ÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÝ  ÝHOkidata OL840 PostScriptOOL840PS.PRShhhhhhhhðe D­3|xbò(Ó3Ò}$¢¢Ý ƒ µ>!ÝÒ(°ÒÒ(°ÒÑÀ°ÑÑÀ°ÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÝ  Ý(·µ>$¡¡Ò(°ÒÒ(°ÒÑÀXÑÑÀXÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÿU‹ÿÀÀÀ Ý ƒÒ})ÝÒ(°ÒÒ(°ÒÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÓ  ÓÝ  ÝòòÔ.Fƒ6D:\X3J3\COMMAN~1\97-110.WPDFÔD:\X3J3\COMMAN~1\97-110.WPDÔ/  Ôóóà@NN(ìà-Ú  Ú1Ú  Ú-ˆà€½½+°"àòòRevision€Date:€January€10,€1997óó(Ó3Ò}$©©Ý ƒ µ>!ÝÒ(°ÒÒ(°ÒÑÀ°ÑÑÀ°ÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÝ  Ý «gQ¨Z8NewCenturySchlbk Regular WUXDYZ[H\]^e_Êbʳ'"2öàp`4New Century SchoolbookÈ(Ó3Ò}$££Ý ƒ µ>!ÝÒ(°ÒÒ(°ÒÑÀ°ÑÑÀ°ÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÝ  Ý,,,,'ÿÿdxd düÿP Pd<)>?Cþÿ<< CÿÿƒLevel 1Level 2Level 3Level 4Level 5($$””ò òÚ  Ú1Ú  Úó ó11'÷ÿ dxdõÿÿÿÿdÝ ƒ µ>!ÝÒ(°ÒÒ(°ÒÑÀ°ÑÑÀ°ÑÔ€òçòòòÔÔ€ô¬?ôòòçÔÓ °°§,°œXÓÔ  ÔÑ  ÑÓ  ÓÝ  ݛրÿÿÖ¢Ö€ÿÿÖ£ñbñÔ% € Ôñbñà@bbìàò òòòCommand€Line€Arguments€&€Environment€Variablesóóó óˆÐ   ÐÌà@SS"ìàby€Craig€T.€DedoˆÌà@CC"ìàJanuary€10,€1997ˆÌÌò ò1.€€Rationaleó óÐ 9 7 Ðà T àGetting€command€line€arguments€and€environmental€variables€is€obviously€desirable€since€itÏhas€been€implemented€in€a€vendor-specific€manner€on€a€wide€variety€of€machines€and€a€wideÏvariety€of€compilers.€€This€capability€is€already€part€of€the€standard€functionality€for€C€and€C++.¼à T àÌÌà T àThis€feature€allows€application€developers€a€way€of€passing€information€to€their€program€rightÏat€startup.€€Such€information€can€be€very€valuable€in€configuring€the€program€before€passingÏcontrol€over€to€users€or€in€performing€other€important€tasks€such€as€opening€documents€and€files.€ÏThis€requirement€requires€direct€access€to€the€operating€system.€€Right€now,€these€capabilities€areÏbeyond€the€current€definition€of€the€Fortran€œlanguage.€€ñWñÌñWññWñÌñWññ^ñ›ñ^ññWñà T àñWññXññVñsñVññXññYñSñYñimilarly,€ñ^ñ›œñ^ññZñproviding€a€means€for€ñZññ\ñan€executing€program€ñ\ññ[ññZñapplication€developers€ñZññ[ññZñto€obtain€the€program's€startupÏcommand€ñZññ]ñ›ñ]ññ]ñwill€allow€the€program€to€use€this€information€in€order€to€find€related€files€that€it€needsÏor€for€other€purposes.ñ]ññ^ñ›ñ^ñÌœñbññ_ñÔ% € Ôñ_ññbñ›Ìà T àThe€basic€functionality€for€command€line€arguments€is€common€among€implementations.€ÏHowever,€there€is€no€de-facto€standard€means€to€specify€it.€€Section€4€of€this€paper€contains€a€listÏof€some€vendor„specific€implementations.ÌÌà T àSome€systems€also€offer€environmental€variables,€process„defined€symbols,€process„definedÏlogical€names,€or€system„defined€logical€names.€€Some€of€this€functionality€could€be€incorporatedÏby€an€intrinsic€which€returns€a€processor-defined€result€when€passed€a€character€variable.€ÌÌà T àNot€all€environments€have€a€command€line€to€return.€€However,€an€implementation€shouldÏreturn€a€status€field€and€one€status€can€be€that€there€is€no€processor-defined€command€line€toÏreturn.€€By€analogy,€the€¢DATE_AND_TIME£€intrinsic€is€provided€even€though€some€systems€do€notÏhave€real-time€clocks.ÌÌà T àAlthough€it€is€highly€likely€that€windowing€operating€systems€will€dominate€the€computers€ofÏthe€future,€it€is€unlikely€that€the€need€for€this€feature€will€go€away.€€Most€windowing€operatingÏsystems€already€have€a€means€of€providing€command€line€arguments€and/or€environmentalÏvariables€at€program€startup.ÌÌà T àIt€is€the€intent€of€this€paper€to€provide€the€same€functionality€which€is€currently€available€inÏC€and€C++€compilers.€€Desirable€features€include:Ìððà0 T àà0€T°"T°"àà T àA€user€interface€which€is€easily€understood,€easy€to€use,€and€which€has€the€look„and„feel€ofÐ 5)3 ) ÐFortran.Ð €°"€°" Ðððà0 T àà0€T°"T°"àà T àParallel€syntax€between€the€command€line€and€environmental€variables.ÐÃ*Á!+€°"€°" Ðððà0 T àà0€T°"T°"àà T àAbility€to€treat€the€command€line€as€either€a€string€or€as€a€series€of€arguments.€€This€is€similarÐ Š+ˆ", Ðâ âto€the€DATE/TIME€vs€VALUES€option€in€the€DATE_AND_TIME€routine.ÐQ,O#-€°"€°" Ðððà0 T àà0€T°"T°"àà T àAutomatic€parsing€of€the€command€line€based€on€blank€delimiters.€€Many€users€want€thisÐ   Ðâ âfeature€without€the€bother€of€doing€the€grunt€work€themselves.Ð €°"€°" Ðððà0 T àà0€T°"T°"àà T àAllowing€for€systems€which€can€only€return€the€command€line€tail€vs€systems€which€can€returnÐ  Ž Ðthe€full€command€line.Ð €°"€°" Ðððà0 T àà0€T°"T°"àà T àAbility€to€provide€an€error€status€including€the€fact€that€no€command€line€can€be€provided€orÐ   Ðthe€specified€environmental€variable€does€not€exist.Ð €°"€°" М̛ÌÔ& q Ôò ò2.€€Technical€Specificationó óÐ :8 ÐÌà T àThis€proposal€adds€two€separate€intrinsic€subroutines€with€parallel€syntax.€€This€proposalÏassumes€that€the€Allocatable€Extensions€TR€will€become€part€of€Fortran€2000€in€substantially€itsÏcurrent€form.ÌÌÔ'q:ßÔà T àThe€subroutine€¢GET_COMMAND_LINE£€obtains€information€from€the€program's€command€line.€ÏThis€information€includes:Ìððà0 T àThe€number€of€command€line€arguments,Ðrp T°"T°" Ðððà0 T àThe€file€name€of€the€program€which€is€executing,Ð97 T°"T°" Ðððà0 T àà0€T°"T°"àà T àThe€command€line€tail,€i.e.€that€part€of€the€command€line€which€starts€with€the€first€non„blankÐ þ  Ðcharacter€after€the€program€name,Ð €°"€°" Ðððà0 T àAutomatic€parsing€of€the€command€line€tail€into€individual€command€line€arguments,€andÐŽŒT°"T°" Ðððà0 T àReturn€of€the€subroutine's€completion€status.ÐUST°"T°" ÐÌà T àThe€subroutine€¢GET_ENVIRONMENT£€obtains€information€from€the€program's€environment.ÌÌà T àMost€of€the€arguments€€of€these€two€subroutines€are€of€type€CHARACTER.€€Any€mismatchÏbetween€the€length€of€the€argument€and€its€associated€value€is€resolved€according€to€the€usual€rulesÏfor€CHARACTER€assignment,€i.e.,€the€CHARACTER€value€is€truncated€or€blank€filled€on€the€rightÏas€necessary.€€If€the€KIND€type€or€character€set€of€the€target€variable€cannot€represent€theÏassigned€value,€an€error€occurs.ÌÌà T à¢GET_COMMAND_LINE£€(€¢NARGUMENTS£,€¢STARTUP_COMMAND£,€¢COMMAND_LINE£,Ï¢COMMAND_ARGUMENTS£,€¢ISTATUS£€)€obtains€command€line€arguments€and€related€information.€ÏCommand€line€arguments€appear€after€the€command€which€starts€the€program€and€are€separatedÏfrom€each€other€by€one€or€more€blanks.ÌÌà T àAll€five€arguments€are€optional€and€are€INTENT€(OUT).ÌÌà T à¢NARGUMENTS£€is€a€scalar€of€type€INTEGER€of€any€kind€that€is€defined€on€the€processor.€€ItÏis€assigned€the€number€of€command€line€arguments€which€appear€after€the€command€which€startsÏthe€program.€€If€there€is€no€command€line€or€command€line€tail,€it€is€assigned€the€value€zero€(0).ÌÌà T à¢STARTUP_COMMAND£€is€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€assigned€the€file€name€of€the€program€which€is€executing.€€The€value€ofÏ¢STARTUP_COMMAND£€is€the€same€value€which€would€be€returned€by€executing€an€INQUIREÏ(FILE=òòfile-name-¢expr£óó€)€statement€on€the€program's€file€name.€Ð ý+û"- ÐÐ Ä,Â#. Ðà T à¢COMMAND_LINE£€is€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€assigned€the€value€of€the€command€line€tail,€i.e.€everything€from€the€first€non„blankÏcharacter€following€the€program€name€to€the€end€of€the€command€line.€€If€there€is€no€command€lineÏor€command€line€tail,€it€is€assigned€all€blanks.ÌÌà T à¢COMMAND_ARGUMENTS£€is€a€rank€one€allocatable€array€of€type€CHARACTER€of€any€kindÏwhich€is€defined€on€the€processor.€€Each€array€element€is€assigned€the€respective€argument€of€theÏcommand€line,€in€the€order€in€which€the€argument€appears€on€the€command€line.€€Each€commandÏline€argument€is€separated€from€the€other€arguments€by€blanks.€€A€command€line€argument€whichÏis€enclosed€by€quotes€or€apostrophes€is€treated€as€a€single€argument,€even€if€it€contains€embeddedÏblanks.€€If€¢COMMAND_ARGUMENTS£€is€not€allocated€at€the€time€of€a€call€toÏ¢GET_COMMAND_LINE£,€it€is€allocated€with€a€dimension€of€¢NARGUMENTS£,€and€each€element€hasÏthe€length€of€the€longest€argument.€€If€there€is€no€command€line€or€command€line€tail€andÏCOMMAND_ARGUMENTS€is€not€already€allocated,€COMMAND_ARGUMENTS£€has€a€dimensionÏof€one€and€is€assigned€all€blanks.ÌÌà T à¢ISTATUS£€is€a€scalar€of€type€INTEGER€of€any€kind€that€is€defined€on€the€processor.€€On€returnÏfrom€the€subroutine,€¢ISTATUS£€is€assigned€the€operating€system€completion€status€if€it€is€available.€ÏOtherwise,€the€value€of€¢ISTATUS£€is€processor€dependent.ÌÌÌà T à¢GET_ENVIRONMENT£€(€NAME,€VALUE€,€¢ISTATUS£)€obtains€the€value€of€the€namedÏenvironment€variable.ÌÌà T àNAME€is€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€the€processor.€€It€is€anÏINTENT€(IN)€argument.€€It€contains€the€name€of€the€environment€variable€for€which€the€value€isÏrequired.ÌÌà T àVALUE€is€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€the€processor.€€It€is€anÏINTENT€(OUT)€argument.€€It€is€assigned€the€value€of€the€environment€variable€which€is€containedÏin€NAME.€€ÌÌà T à¢ISTATUS£€is€a€scalar€of€type€INTEGER€of€any€kind€that€is€defined€on€the€processor.€€It€is€anÏINTENT€(OUT)€argument.€€On€return€from€the€subroutine,€¢ISTATUS£€is€assigned€the€operatingÏsystem€completion€status€if€it€is€available.€€Otherwise,€the€value€of€¢ISTATUS£€is€processorÏdependent.ÌÌòòExampleóósÐ Å%Ã% ÐÔ‡ÂK–Âôô¬?ÔÓ  Ó1.à T àAssume€that€the€operating€system's€status€code€for€"success"€is€1,€Ô#†ô¬?ôÂÂK–1$#ÔÔ‡ÂK–Âôô¬?Ôthe€executing€program's€file€isÐ Œ&Š& Ð$1$œDKA100›:[œDEVELOPMENT.EXAMPLES]DEMO.EXE;15›,€and€the€program€has€the€following€commandÏœline€tail:›Ìà8 T à/LIST€€"Here€comes€Fortran€2000!"€€EXPERIMENTAL:[œFORTRAN_2000]TESTFILE.TXT›Ð T„!T„! МIf€successful,€the›€reference€Ô#†ô¬?ôÂÂK–Ð$#ÔÔ‡ÂK–Âôô¬?ÔGET_COMMAND_LINE£€(€¢NARGUMENTS£=N,€¢STARTUP_COMMAND£=S,Ð h)f * ТCOMMAND_LINE£=C,€¢COMMAND_ARGUMENTS£=A,€¢ISTATUS=I£€)€assigns€the€following€values€to€theÏarguments:ÌòòArgumentóóà ¬ àà Ø àòòValueóóÐ +‹"- ÐNà T àà € àà ¬ àà Ø ààб ±  à3ˆÐ D,B#. ÐSà T àà € àà ¬ àà Ø à$1$œDKA100›:[œDEVELOPMENT.EXAMPLES]DEMO.EXE;15›Ô#†ô¬?ôÂÂK–<&#ÔÔ‡ÂK–Âôô¬?ÔÐ û,ù#/ ÐCà T àà € àà ¬ àà Ø à/LIST€€"Here€comes€Fortran€2000!Ô#†ô¬?ôÂÂK–1(#ÔÔ‡ÂK–Âôô¬?Ô"€€EXPERIMENTAL:[œFORTRAN_2000]TESTFILE.TXT›Ô#†ô¬?ôÂÂK–Ù(#ÔÔ‡ÂK–Âôô¬?ÔÐ   ÐA(1)à € àà ¬ àà Ø à/LISTÐ ¹ · ÐA(2)à € àÔ#†ô¬?ôÂÂK–G)#ÔÔ‡ÂK–Âôô¬?Ôà ¬ àà Ø àHere€comes€Fortran€2000!Ô#†ô¬?ôÂÂK–ð)#ÔÔ‡ÂK–Âôô¬?ÔÐ p n ÐA(3)à € àÔ#†ô¬?ôÂÂK–b*#ÔÔ‡ÂK–Âôô¬?Ôà ¬ àà Ø àEXPERIMENTAL:[œFORTRAN_2000]TESTFILE.TXT›Ô#†ô¬?ôÂÂK–É*#ÔÔ‡ÂK–Âôô¬?ÔÐ ' % ÐIàÐTT TàˆàЀ€€àˆà ¬ àà Ø ààб ±  à1ˆÐ Þ Ü ÐÌ2.à T àAssume€that€the€operating€system's€status€code€for€"success"€is€0,€the€value€of€the€PATH€environmentÐ L J Ðvariable€is€"C:\œWINNT40;C›:\œWINNT40›\œSYSTEM32;D›:\",€and€the€value€of€E€is€PATH.€€œIf€successful,€the›Ïreference€œGET_ENVIRONMENT›€(€NAME=E,€VALUE=V,€ISTATUS=I)€assigns€the€following€values€to€theÏargumentsÌòòArgumentóóà ¬ àà Ø àòòValueóóÐ (&  ÐVà T àà € àà ¬ àà Ø àC:\œWINNT40;C›:\œWINNT40›\œSYSTEM32;D›:\Ô#†ô¬?ôÂÂK–L+#ÔÔ‡ÂK–Âôô¬?ÔÐ ßÝ  ÐIà T àà € àà ¬ àà Ø ààб ±  à0ˆÐ –”  ÐÌÔ#†ô¬?ôÂÂK–.#ÔÓP$Óò ò3.€€Proposed€Edits€to€be€Operated€on€Lateró óÐ   Ðà T àThese€edits€are€preliminary€and€are€provided€primarily€as€a€basis€for€discussion.€€They€are€withÏrespect€to€the€Fortran€95€Committee€Draft,€X3J3€/€96¢œ„007r1›£.ÌÌÔ& « Ôà T àAdd€the€following:Ìò òœ13.14.38a›à ¬ àà0 Ø àà ¬ àGET_COMMAND_LINE£€(€¢[NARGUMENTS£,€¢STARTUP_COMMAND£,Ð çå  ТCOMMAND_LINE£,€¢COMMAND_ARGUMENTS£,€¢ISTATUS£]€)ó óЮ¬Ø °"Ø °" ÐÌà0 T àò òDescription.ó óà  àObtains€the€command€line€and€related€information€from€the€operating€system.Ð<:T°"T°" ÐÔ'« ¹/ÔÌà0 T àò òClass.ó óà ¬ àSubroutine.ÐËÉT°"T°" ÐÌà T àò òArguments.ó óÐ ZX Ðà0 T àNARGUMENTS€(optional)Ð T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€scalar€and€of€type€INTEGER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€an€INTENT€(OUT)€argument.€€It€is€assigned€the€numberÏof€command€line€arguments€which€appear€after€the€command€which€startsÏthe€program.€€If€there€is€no€command€line€or€command€line€tail,€it€isÏassigned€the€value€zero€(0).Ð 0 °"0 °" ÐÌà0 T àSTARTUP_COMMAND€(optional)Ð T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€scalar€and€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÏprocessor.€It€is€an€INTENT€(OUT)€argument.€€It€is€assigned€the€file€nameÏof€the€program€which€is€executing.€€The€value€of€¢STARTUP_COMMAND£€isÏthe€same€value€which€would€be€returned€by€executing€an€INQUIREÏ(FILE=òòfile-name-¢œexpr›£óó€)€statement€on€the€program's€file€name.€Ðu&s'0 °"0 °" ÐÌà0 T àCOMMAND_LINE€(optional)Ð T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€an€INTENT€(OUT)€argument.€€It€is€assigned€the€value€ofÏthe€command€line€tail,€i.e.€everything€from€the€first€non„blank€characterÏfollowing€the€program€name€to€the€end€of€the€command€line.€€If€there€is€noÏcommand€line€or€command€line€tail,€it€is€assigned€all€blanks.Ð 0 °"0 °" ÐÌà0 T àCOMMAND_ARGUMENTS€(optional)Ðt-r$0T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€a€rank€one€allocatable€array€of€type€CHARACTER€of€any€kindÏwhich€is€defined€on€the€processor.€€It€is€an€INTENT€(OUT)€argument.€€EachÏarray€element€is€assigned€the€respective€argument€of€the€command€line,€inÏthe€order€in€which€the€argument€appears€on€the€command€line.€€EachÏcommand€line€argument€is€separated€from€the€other€arguments€by€blanks.€ÏA€command€line€argument€which€is€enclosed€by€quotes€or€apostrophes€isÏtreated€as€a€single€argument,€even€if€it€contains€embedded€blanks.€€IfÏ¢COMMAND_ARGUMENTS£€is€not€allocated€at€the€time€of€a€call€toÏ¢GET_COMMAND_LINE£,€it€is€allocated€with€a€dimension€ofÏ¢NARGUMENTS£,€and€each€element€has€the€length€of€the€longest€argument.€ÏIf€there€is€no€command€line€or€command€line€tail€andÏCOMMAND_ARGUMENTS€is€not€already€allocated,ÏCOMMAND_ARGUMENTS€has€a€dimension€of€one€and€is€assigned€allÏblanks.Ð 0 °"0 °" ÐÌà0 T àISTATUS€(optional)Ð T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€a€scalar€of€type€INTEGER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€an€INTENT€(OUT)€argument.€€On€return€from€theÏsubroutine,€¢ISTATUS£€is€assigned€the€operating€system€completion€statusÏif€it€is€available.€€Otherwise,€¢ISTATUS£€is€assigned€a€processor„dependentÏvalue.Ð 0 °"0 °" ÐÌÌÔ&  Ôò òœ13.14.38b›à ¬ àà0 Ø àà ¬ àœGET_ENVIRONMENT›€(€NAME,€VALUE€[,€ISTATUS]€)ó óÐãáØ °"Ø °" ÐÌà0 T àò òDescription.ó óà  àObtains€the€value€of€a€named€environment€variable.ÐqoT°"T°" ÐÔ'ã!>ÔÌà0 T àò òClass.ó óà ¬ àSubroutine.ÐþT°"T°" ÐÌà T àò òArguments.ó óÐ  Ðà0 T àNAMEà0¬T°"T°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€scalar€and€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÐ V T Ðprocessor.€€It€is€an€INTENT€(IN)€argument.€It€contains€the€name€of€theÏenvironment€variable€for€which€the€value€is€required.Ð 0 °"0 °" ÐÌà0 T àVALUEà0Ø T°"T°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€a€scalar€of€type€CHARACTER€of€any€kind€that€is€defined€on€theÐ r#p" Ðprocessor.€€It€is€an€INTENT€(OUT)€argument.€It€is€assigned€the€value€of€theÏenvironment€variable€which€is€contained€in€NAME.€€Ð 0 °"0 °" ÐÌÔ&  Ôà0 T àISTATUS€(optional)Ð T°"T°" Ðà0 T àà0€T°"T°"àà0¬€°"€°"àà0Ø ¬°"¬°"àà0 Ø °"Ø °"àà00  °" °"àshall€be€a€scalar€of€type€INTEGER€of€any€kind€that€is€defined€on€theÏprocessor.€€It€is€an€INTENT€(OUT)€argument.€€On€return€from€theÏsubroutine,€¢ISTATUS£€Ô'Ž&MBÔis€assigned€the€operating€system€completion€statusÏif€it€is€available.€€Otherwise,€¢ISTATUS£€is€assigned€a€processor„dependentÏvalue.Ð 0 °"0 °" ÐÌ[End€of€Proposed€Edit]ÌÐ Æ,Ä#. Їò ò4.à0 T àSummary€of€Vendor-Specific€Implementationsó óÐ T°"T°" Ðà T àHere€is€a€summary€of€some€vendor-specific€implementations.€€This€information€was€preparedÏby€David€Mattoon€as€part€of€the€material€contained€in€X3J3€JOR€Item€016.ÌÌððà0 T àà0€T°"T°"àà T àDigital€Fortran€(formerly€DEC€Fortran€and€VAX€Fortran)€for€OpenVMS€requires€that€theÐ   Ðprogram€be€invoked€as€a€"foreign€command."€Subroutine€LIB$œGET_FOREIGN›Ï(COMMAND_LINE,€PROMPT,€œCOMMAND_LEN›,€FLAGS)€is€called€whereÏCOMMAND_LINE€returns€the€command€line€tail,€PROMPT€displays€a€prompt€for€the€userÏto€supply€a€command€line€tail€interactively,€œCOMMAND_LEN›€optionally€returns€the€lengthÏof€the€command€line€tail,€and€FLAGS€is€an€argument€for€a€"utility€command€collector"€notÏneeded€for€this€application.Ð €°"€°" ÐÌððà0 T àà0€T°"T°"àà T àIBM€AIX/6000:€¢œGETARG›£(I,€C)€is€a€subroutine€where€I€specifies€which€command€line€argumentÐ VT  Ðto€return€(0=program€name),€C€is€an€argument€of€type€character€and€will€contain,€uponÏreturn€from€œGETARG›,€the€command€line€argument.€€Subroutine€œGETENV›€('œENVNAM›',ÏRESULT)€stores€in€character€variable€RESULT€the€value€of€the€environmental€variableÏœENVNAM›€in€the€profile€file€of€the€current€directory.Ð €°"€°" ÐÌððà0 T àà0€T°"T°"àà T àHP€has€a€function€œIARGC›()€which€returns€the€number€of€arguments€and€a€subroutine€œGETARG›Ð þ  Ð(œTHSARG›,€œARG›)€which€returns€the€œTHSARG›-œth›€argument€from€the€built-in€œARG›€array.Ð €°"€°" ÐÌððà0 T àà0€T°"T°"àà T àLahey€Fortran:€Subroutine€œGETCL›€returns€a€string€containing€the€command€tail;€everythingÐ US Ðafter€the€command€and€the€blank€separator.Ð €°"€°" ÐÌððà0 T àà0€T°"T°"àà T àMicrosoft€Fortran:à 0 àœNARGS›()is€a€function€which€returns€the€number€of€arguments.€€œGETARG›Ð ª¨ Ð(œTHSARG›,€œARGMNT›,€STATUS)€is€a€subroutine€where€œTHSARG›€specifies€which€commandÏline€argument€is€desired€(0=program€name),€œARGMNT›€is€the€actual€command€lineÏargument,€and€STATUS€is€a€status:€if€<€0,€an€error€occurred.€€If€>€0,€it€is€the€length€of€theÏcommand€line€argument€returnedÐ €°"€°" ÐÌÌÔ&  Ôò ò5.à0 T àReferencesó óÐ!T°"T°" Ðà0 T àà ( àInternational€Business€Machines€Corporation.€€December€1993.€€òòAIX/XL€Fortran€Compiler/6000Ð â!à  ÐLanguage€Reference€Version€3€Release€1.óó€€North€York,€ON:€€International€Business€MachinesÐ ©"§! ÐÔ'!™MÔCorporation.€€pp.€401,€441.Ð T°"T°" ÐÌà0 T àà ( àLahey€Computer€Systems.€€1995.€€òòFortran€90€Language€Reference€Revision€B.óó€€Incline€Village,€NV:€Ð þ$ü$ ÐLahey€Computer€Systems.€€pp.€131,€263.Ð T°"T°" ÐÌX3J3€/€96œ-004r1›,€X3J3€Journal€of€Requirements,€Items€016,€040,€and€041.Ì