I am using GNAT's,2018, GPS on 1 2012 Macbook Pro, Intel Chip, for
some Ada programming with IO to a terminal. I want to capture the
cursor position, row, and column with Text_IO line and col functions returning to my variables of type Positive_count, declared in my
package's specification, *.ids file, Compile fails with an ambiguous
message about my line of code that calls line and col returning to Postiive_count type variables.
-- combinations.ads -- physical file
with gearbox; use gearbox;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Term_IO; use TERM_IO;
with Text_IO; use Text_IO;
package combinations is
...
col_is : Positive_Count ; -- types from Text_IO
row_is : Positive_Count ;
procedure build;
...
end combinations;
-- *************************************
-- combinations.adb -- physical file
package body combination is
....
procedure build is
..
begin
...
put(" Row is " ); put(row_is);
put(" Column is "); put(col_is);
...
end combinations;
-- *****************************
compiler error
line_no : no candidate interpretations match the actual:
missing argument for parameter 'Item' in call to "put"
...
possible missing instantiation of Text_IO.Integer_IO
expected type "Standard Integer"
found type Ada.Text_IO.count
____
This is different error than before and I easily see Put() is
expecting Integer but has the.. count type; so I need some sort of translation to satisfy put(), maybe with and use Text_IO.Integer_IO
as error message suggest?
____
This is different error than before and I easily see Put() is expecting Integer but has the.. count type; so I need some sort of translation to satisfy put(), maybe with and use Text_IO.Integer_IO as error message suggest?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 405 |
Nodes: | 16 (2 / 14) |
Uptime: | 55:52:00 |
Calls: | 8,500 |
Calls today: | 1 |
Files: | 13,203 |
Messages: | 5,917,357 |