Ejemplo
withAda.Text_IO;withAda.Command_Line;useAda.Command_Line; -- Imprime los argumentos pasados por línea de comandosprocedureImprimir_ArgumentosisbeginAda.Text_IO.Put_Line ("Imprimiendo argumentos pasados a " & Command_Name & '.');forIin1 .. Argument_CountloopAda.Text_IO.Put_Line ("Argumento nº" & Integer'Image (I) & ": " & Argument (I));endloop; Set_Exit_Status (Success);exceptionwhenothers=> Set_Exit_Status (Failure);endImprimir_Argumentos;
Especificación
packageAda.Command_LineispragmaPreelaborate(Command_Line);functionArgument_CountreturnNatural;functionArgument (Number :inPositive)returnString;functionCommand_NamereturnString;typeExit_Statusisimplementation-defined integer type; Success :constantExit_Status; Failure :constantExit_Status;procedureSet_Exit_Status (Code :inExit_Status);private...endAda.Command_Line;