Bug in GNAT Get(FRom => SomeString, Item => SomeInteger, Last => Last)?
23 May 2023 at 18:22
Get(TheFile, IntValue); works great with strings formatted like 16#12# to read hex values. Shouldn't Get from a string function the same way?
I tried this, but passing 16#12# only yields 16. Pure hex, eg F8 results in an exception
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure hex is
IntValue : Integer;
Last : Positive;
begin
Put("Enter a hexadecimal string: ");
Get(HexString);
-- Convert the hexadecimal string to an integer
Get(From => HexString, Item => IntValue, Last => Last);
Put ("The integer value is: ");
Put (IntValue, Width => 0);
New_Line;
end hex;