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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f0d4996d72f29e1e X-Google-Attributes: gid103376,public From: Ade Vickers Subject: Re: clearing a screen in ada? (new to ada) Date: 2000/03/07 Message-ID: <38C5090D.2C5C9D33@ttoolsbase.com>#1/1 X-Deja-AN: 594259375 Content-Transfer-Encoding: 7bit References: <38c1621e$0$19330@motown.iinet.net.au> <2000Mar4.144232.1@eisner> <38c3fb98$0$16303@motown.iinet.net.au> <38C53105.CBD5B94A@quadruscorp.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Toolsbase Ltd Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-03-07T00:00:00+00:00 List-Id: "Marin D. Condic" wrote: > > Nigel wrote: > > > > ahhh sorry I am using GNAT on a PC using the ADAGIDE, we basically are only > > allowed to use the standard libs/packages that come with gnat, and I was > > hoping to find infor for moving the cursor round the screen such as using a > > comand like CLS to clear the screen and also the LOCATE type commands for > > postioning the cursor, I have tried using set_col and set_line in the > > Text_IO package, but it only works in a positive manner and so I can't go > > back up the screen. basically I am righting a box prog to make my input > > screens look a little more interesting, and not being able to move the > > cursor back up the screen when I have drawn the box is making this hell > > thanks once again for help :o) > > You could "roll your own" screen control code. All you have to do is > send the proper escape sequences to the terminal and you can get it to > clear the screen, position the cursor, etc. You can send the escape > sequences using Ada.Text_IO facilities, so there isn't anything > non-standard about it. You can probably get by if you build a small > package with two procedures: Clear_Screen and Goto_XY. Just get the > escape sequences for those two features and wrap a little code around > the Goto_XY one to convert its parameters to proper screen coordinates. The distribution of GNAT I downloaded the other day contains (in the Examples directory) a file to do just this: screen.ads/.adb. > Anybody remember off the top of their head what the escape codes are for > those functions? ESC[2J - clear screen ESC[yy;xxf - move to row yy, col xx That's contained within screen.adb; my memory would never have stretched to remembering those... -- Cheers, Ade. If at first you fail, cheat. Repeat until caught, then lie.