comp.lang.ada
 help / color / mirror / Atom feed
From: colbert@hermix.UUCP.UUCP
Subject: RE: OCharacters with codes >= 128
Date: Tue, 1-Sep-87 22:35:35 EDT	[thread overview]
Date: Tue Sep  1 22:35:35 1987
Message-ID: <8709020424.AA05821@rand-unix.rand.org> (raw)

You can create your own Character type by defining an enumeration type that
has character literals.

e.g.

	type Character_Type is (Nul, Del, ..., 'A', 'B', ...,
				Koo_Kai, Khoo_Khai, ....);


Where Koo_Kai and Khoo_Khai (etc) are the special characters in your language
(these letters are phonetic Thai characters).

You can then use an enumeration representation specification to map the enumer-
ation literals to the appropriate extended ASCII values.

Once you have this character type defined, you can create a string type by
defining an array of this character type:

e.g.

	type String_Type is array (positive <>) of Character_Type;

This allows you to use string literals such as the following:

	"This is a string of String_Type"  -- may require type qualification

However, you will have to use catenation to create string_type expressions that
contain your countries special characters (and of course non-printable
characters).

E.g.

	"This is a '" & Koo_Kai & "' while this is a '" & Khoo_Khai & "'"

As for the I/O of your language specific characters, you will need to create
a Thai_Text_IO (or something equivalent).  Ada does not say that Text_IO is
the ONLY text I/O package, only that it is the standard text I/O package.  In
this case you need something non-standard.

I hope this is of help.

Take care,

Ed Colbert
Absolute Software
4593 Orchid Dr
Los Angeles, CA 90043-3320
USA
(213) 293-0783
hermix!colbert@rand-unix.arpa			ARPA
(trwrb!, sesmo!, ...)hermix!colbert		UUCP


P.S.  See LRM Sections 2.6 (String Literals), 3.5.2 (Character Types),
		       3.6.3 (The Type String), 4.2 (Literals).

             reply	other threads:[~1987-09-02  2:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-09-02  2:35 colbert [this message]
1987-09-05 20:43 ` Characters with codes >= 128 sommar
replies disabled

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