From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c9f30a6d8592220,start X-Google-Attributes: gid103376,public From: "Robert A. Thompson" Subject: is there a put and wait Date: 1997/11/30 Message-ID: <348139C0.30EBF63E@unx1.shsu.edu>#1/1 X-Deja-AN: 293860142 Organization: Sam Houston State University Reply-To: stdrat01@unx1.shsu.edu Newsgroups: comp.lang.ada Date: 1997-11-30T00:00:00+00:00 List-Id: I am working on a homework assignment and am having problems with puting to the screen a statement and then waiting for a resonpse. I am sure it is the multitasking of ada 95 (gnat 3.09 on a windows NT 4.0 system), but it never waits for me to enter the data initially if teh put_line and get are followed by another put? I have tired put, and a package we wrote back in my ada 101 class. PROCEDURE GetName(PName : out string; len: out integer) is begin put_string("Enter a the Name to insert"); get_string(PName,len); end; ----------------------------------------------- PROCEDURE GetNumber(Number : out string; len: out integer) is begin put_string("Enter the corresponding phone number"); get_string(Number,len);new_line; end; ----------------------------------------------- PROCEDURE InsertProc is PName: string(1..12):=(others => ' '); Number: string(1..10):=(others => ' '); len: integer:=1; begin new_line(40); put_string(" "); --- this is to try and cause it to go ahead and skip get_string(pname,len); --- then show what I want ... this is ugly to do it len := 1; --- this way while (len /= 0) or (len /= 0) loop GetName(PName,len); GetNumber(Number,len); end loop; No matter what I do it won't wait. I have used all sorts of put and even the package we wrote...which I show below with text_io; package body jc_strings is procedure get_string(a: out string; n: out integer) is i: integer; b: string(1..80); spc: string(1..a'last):= (others => ' '); begin --get_string text_io.get_line(b,i); if i< a'last then --string inputted has length less than target string --pad with spaces a(1..i):=b(1..i); a(i+1..a'last):=spc(i+1..a'last); n:=i; else --string inputted has length >= target, --truncate to target string a(1..a'last):=b(1..a'last); n:= a'last; end if; end get_string; procedure put_string(a: in string) is loc: integer:= a'last; begin --put_string while loc /=0 loop if a(loc) = ' ' then loc:= loc -1; else exit; end if; end loop; if loc > 0 then text_io.put(a(1..loc)); end if; end put_string; end jc_strings; any help would be appreciated. Robert A. Thompson