Code :
WITH Ada.Text_IO ; USE Ada.Text_IO ; WITH Ada.Text_IO.Unbounded_IO ; USE Ada.Text_IO.Unbounded_IO ; WITH Ada.Strings.Unbounded ; USE Ada.Strings.Unbounded ; Procedure main is this_file : File_type ; Last_case : Positive_Count := 1 ; Begin Open (File => this_file , Mode => In_file , Name => "main.adb" ); loop exit when End_Of_File ( this_file ) ; set_line( this_file , Last_case ); Last_case := Last_case + 1 ; end loop ; Close ( this_file ); put ( Positive_Count'image(Last_case)); End main ;
|