mercredi 27 avril 2016

Ada thread to pass auto random generated data to a procedure

How would i go about creating a procedure that is a thread which continuously passes automatic random generated data within a specified range.

I currently would have to manually enter in each bit of data in the console using this procedure below. I want to creatre a procedure that when running is able to pass data to this procedure as if it was being typed into the console itself.

procedure Analyse_Data is
  Data : Integer;
begin
  DT_Put_Line("Data input by user");
  loop
     DT_Get(Data,"Data must be taken as a whole number");
     exit when (Data >=0) and (Data <= Maximum_Data_Possible);
     DT_Put("Please input a value between 0 and ");
     DT_Put(Maximum_Data_Possible);
     DT_Put_Line("");
  end loop;
  Status_System.Data_Measured := Data_Range(Data);
end Analyse_Data;

I havent included the specification files (.ads) I am new to Ada and any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire