comp.lang.ada
 help / color / mirror / Atom feed
* Help translating to ADA...
@ 1996-11-29  0:00 bamba_i
  1996-11-29  0:00 ` Larry Kilgallen
  0 siblings, 1 reply; 2+ messages in thread
From: bamba_i @ 1996-11-29  0:00 UTC (permalink / raw)


[-- Attachment #1: HELP.TXT.1 --]
[-- Type: text/plain, Size: 991 bytes --]


Hi all!

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


Please notice this is no assignment ! 8^}
ANY help,comment,proposal,suggestion or else ( code???) will be
GREATLY!!!!! appreciated ! ;-}
Also for people using VMS, i might ftp them the binary when done for beta testing if they are interested.

Please e-mail me at :Bamba_I@Cnam.fr 
Rgds,
Ishmael.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Help translating to ADA...
  1996-11-29  0:00 Help translating to ADA bamba_i
@ 1996-11-29  0:00 ` Larry Kilgallen
  0 siblings, 0 replies; 2+ messages in thread
From: Larry Kilgallen @ 1996-11-29  0:00 UTC (permalink / raw)



In article <329EDB81.494E2D07@cnam.fr>, bamba_i <bamba_i@cnam.fr> 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-11-29  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-29  0:00 Help translating to ADA bamba_i
1996-11-29  0:00 ` Larry Kilgallen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox