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,5f05fd52c45de56c X-Google-Attributes: gid103376,public From: "Steve Doiel" Subject: Re: ObjectAda and ANSI.SYS Date: 1998/06/18 Message-ID: <3589c1e7.0@news.pacifier.com>#1/1 X-Deja-AN: 364049387 References: <35879521.65EE@ddre.dk> <3587B2D4.489C@ddre.dk> X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3 Newsgroups: comp.lang.ada Date: 1998-06-18T00:00:00+00:00 List-Id: Hans Marqvardsen wrote in message <3587B2D4.489C@ddre.dk>... >Hans Marqvardsen wrote: >> >> I am reading Feldman&Koffman:Ada95 and would like to use their SCREEN >> package on Windows NT4.0 (and also Windows 95). >> >> The book says I have to install ANSI.SYS first. >> I spent an hour or so trying to get this to work, then found an indication in the NT help files that ANSI.SYS and CONFIG.NT don't apply to 32 bit NT applications. What follows is my implementation of the Screen package body that works. It is not optimal but it does the job. It also requires Win32Ada which may be obtained from the AdaIC. Patches are available from Pascal Obry's web page. SteveD ========================================================= pragma Linker_Options( "-lkernel32" ); WITH Win32; WITH Win32.WinNt; WITH Win32.WinBase; WITH Win32.WinCon; WITH Ada.Text_Io; WITH System; PACKAGE BODY Screen IS ------------------------------------------------------------------------ --| Body of screen-handling package --| Author: Michael B. Feldman, The George Washington University --| Last Modified: July 1995 --| Modified SJD, Oct 1997 - NT Version ------------------------------------------------------------------------ PACKAGE WinBase RENAMES Win32.Winbase; PACKAGE WinCon RENAMES Win32.WinCon; PACKAGE WinNt RENAMES Win32.WinNt; PACKAGE Text_Io RENAMES Ada.Text_Io; USE type Winnt.Handle; USE type Win32.BOOL; PROCEDURE Beep IS BEGIN Text_IO.Put (Item => ASCII.BEL); END Beep; PROCEDURE ClearScreen IS BEGIN FOR ii IN 1..Screen_Depth LOOP MoveCursor( 1, ii ); Text_Io.Put( String'(1..Screen_Width => ' ') ); END LOOP; END ClearScreen; PROCEDURE MoveCursor (Column : Width; Row : Depth) IS handle : Winnt.Handle; result : Win32.BOOL; BEGIN handle := WinBase.GetStdHandle( WinBase.STD_OUTPUT_HANDLE ); result := WinCon.SetConsoleCursorPosition( handle, WinCon.COORD'( X => Win32.Short( Column ), y => Win32.Short( Row ) ) ); END MoveCursor; END Screen;