comp.lang.ada
 help / color / mirror / Atom feed
From: sk <noname@myob.com>
Subject: Re: how to parse words from a string
Date: Wed, 13 Nov 2002 21:09:06 -0600
Date: 2002-11-13T21:09:06-06:00	[thread overview]
Message-ID: <mailman.1037243581.1145.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: L2EA9.21326$nB.2140@sccrnsc03

Hi,

Caffeine Junky <nospam@hotmail.com>
> Strange. I didnt get any errors when compiling it. A character is an
> element of a String. Maybe I'm missing something. I'll pull out the LRM
> again.

procedure yyy is

    Break : Character := ASCII.HT; -- Horizontal Tab

    subtype Word is String (1 .. Break);

begin
    null;
end yyy;

>> gnatmake -v yyy
 
GNATMAKE 3.14p (20010503) Copyright 1995-2001 Free Software
Foundation, Inc.
  "yyy.ali" being checked ...
  -> "yyy.ali" missing.
gcc -c yyy.adb
yyy.adb:5:31: incompatible types in range
End of compilation
gnatmake: "yyy.adb" compilation error

A string is a numerically indexed array of characters in
simplest terms. So using a character as an index into a 
string should not compile under normal (Ada) circumstances.

-- 
-------------------------------------
-- Merge vertically for real address
-------------------------------------
s n p @ t . o
 k i e k c c m
-------------------------------------



  reply	other threads:[~2002-11-14  3:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-12 19:33 how to parse words from a string Sarah Thomas
2002-11-12 20:15 ` Stephen Leake
2002-11-12 20:16 ` Simon Wright
2002-11-13 10:17 ` Caffeine Junky
2002-11-14  2:10   ` Chad R. Meiners
2002-11-14  2:40     ` Caffeine Junky
2002-11-14  3:09       ` sk [this message]
2002-11-14  5:31         ` Dennis Lee Bieber
2002-11-14 13:40           ` Sarah Thomas
2002-11-14 14:56             ` David C. Hoos
2002-11-14 18:45             ` Jeffrey Carter
2002-11-17  8:40               ` Mário Amado Alves
2002-11-17 21:14                 ` Jeffrey Carter
2002-11-18 11:00                   ` Mário Amado Alves
2002-11-18 19:23                     ` Jeffrey Carter
replies disabled

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