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,c9836315b1342ccc X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Help translating to ADA... Date: 1996/11/29 Message-ID: <1996Nov29.131407.1@eisner>#1/1 X-Deja-AN: 201440748 x-nntp-posting-host: eisner.decus.org references: <329EDB81.494E2D07@cnam.fr> x-nntp-posting-user: KILGALLEN x-trace: 849291253/5918 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-11-29T00:00:00+00:00 List-Id: In article <329EDB81.494E2D07@cnam.fr>, bamba_i writes: > Ive times ago written a aplication in Pascal object V7.00 ,then C++; > i would like to write the same application on a Vax/VMS operating system.The troouble is im totally new to ADA !!! > Actually ive started implementing my working library packages (almost generic methods) but there are still 2 functions i cn't figure out how to write: > > 1) a function returning the position (X,Y) of the cursor ( a kind of > WhereX,WhereY in pascal) > > 2) a function returning the attributes of a character on screen;that is: > > *the actual character:{ a..z } or {A..Z} > *the text color: color used to write character > * the text background color: color of the background the character was written on I believe the solutions you are looking for are not particularly different for Ada on VMS than for Pascal on VMS so if the following is not helpful you would be better off consulting comp.os.vms. I will presume you are programming for a VT terminal or else a DECwindows terminal emulator. If not, the rest of this message can be ignored. WhereX and WhereY are not part of DEC Pascal, so I will presume the Pascal version of your application was on some other operating system. When you what to find out information regarding the current state of the screen, you need to decide what entity you might trust to give you that information: The terminal (or emulator) itself -- which might not support syntax to accept inquiries regarding certain of the items you list. Some screen management package you are using - which might not have been used for the last output to the screen and thus might be ignorant of the current state. If you want to trust the terminal, then your guide is the programmer manual for the particular model of terminal you are using (or emulating). There are various escape sequences which will can inquire of the terminal regarding status. Be sure to use a "read-with-prompt" sort of call to ensure that your output and the response are linked in time, and flush the input buffer first. Even at that, there is a possibility the user could type something at just the wrong moment, so be prepared to retry if you get a garbage response. If you want to use a screen management package, SMG is the one built in to VMS. When C programmers use the "curses" calls for screen manipulation on VMS, the calls are actually going to SMG. Alternative extra-cost screen management packages include FMS, TDMS and DECforms. So using the calls specific to your screen management package you can inquire regarding the current state of the terminal AS FAR AS IS KNOWN TO THE SCREEN MANAGEMENT PACKAGE. You must do all your screen manipulation through that package if you expect it to have knowledge of screen state. If you avoid using a screen management package and decide instead to use terminal inquiry directly, you will probably decide it is better to preserve certain state information in software rather than making repeated inquiries of the terminal. Once you do that, you are effectively writing your own screen management package (which may or may not be reflected as a single Ada "package" the way SMG is). The only disadvantage (aside from the work involved), is that you probably will not take the time to program for other models of terminals the way the writers of SMG did. Larry Kilgallen who has used direct calls, FMS and SMG, but not TDMS or DECforms