For Programmers: Free Programming Magazines  


Home > Archive > Pascal > March 2004 > HELP! PROBLEM WITH CONSTANT RECORD DECLARATION!!!









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HELP! PROBLEM WITH CONSTANT RECORD DECLARATION!!!
Amit Layman

2004-03-27, 12:20 am

Hi!

I'm trying to define a constant record this way:

type
TPhoneme = record
phoneme: char;
features: array [1..13] of integer;
isvowel: boolean;
end;

TPhonemes = array [1..24] of TPhoneme;

const
PHONEMES: TPhonemes =
(
(phoneme: 'i'; features: ( 1, -1, 1, -1, -1, -1, -1, -1, 1, 0, 0, 0,
0 ); isvowel: true),
(phoneme: 'e'; features: ( 1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0, 0,
0 ); isvowel: true),
(phoneme: 'a'; features: ( 1, -1, -1, 1, 1, -1, -1, -1, 1, 0, 0, 0,
0 ); isvowel: true),
(phoneme: 'u'; features: ( 1, -1, 1, 1, -1, -1, -1, 1, -1, 0, 0, 0,
0 ); isvowel: true),
(phoneme: 'o'; features: ( 1, -1, -1, 1, -1, -1, -1, 1, 1, 0, 0, 0,
0 ); isvowel: true),
(phoneme: 'y'; features: (-1, -1, 1, -1, -1, -1, -1, -1, -1, 0, 0, 0,
0 ); isvowel: false),
(phoneme: 'r'; features: ( 1, 1, -1, -1, -1, -1, 1, 0, 0, 1,
1, -1, -1 ); isvowel: false),
(phoneme: 'l'; features: ( 1, 1, -1, -1, -1, 1, 1, 0, 0, 1,
1, -1, -1 ); isvowel: false),
(phoneme: 'h'; features: (-1, -1, -1, -1, 1, -1, -1, 0, 0, -1,
1, -1, -1 ); isvowel: false),
(phoneme: 'p'; features: (-1, 1, -1, -1, -1, 1, -1, 0,
0, -1, -1, -1, -1 ); isvowel: false),
(phoneme: 'b'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0,
1, -1, -1, -1 ); isvowel: false),
(phoneme: 't'; features: (-1, 1, -1, -1, -1, 1, 1, 0,
0, -1, -1, -1, -1 ); isvowel: false),
(phoneme: 'd'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0,
1, -1, -1, -1 ); isvowel: false),
(phoneme: 'k'; features: (-1, 1, 1, 1, -1, -1, -1, -1,
0, -1, -1, -1, -1 ); isvowel: false),
(phoneme: 'g'; features: (-1, 1, 1, 1, -1, -1, -1, -1, 0,
1, -1, -1, -1 ); isvowel: false),
(phoneme: 'f'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, -1, 1, -1,
1 ); isvowel: false),
(phoneme: 'v'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, 1, 1, -1,
1 ); isvowel: false),
(phoneme: 'z'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, 1, 1, -1,
1 ); isvowel: false),
(phoneme: 's'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, -1, 1, -1,
1 ); isvowel: false),
(phoneme: 'S'; features: (-1, 1, 1, -1, -1, -1, 1, 0, 0, -1, 1, -1,
1 ); isvowel: false),
(phoneme: 'm'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, 1, -1,
1, -1 ); isvowel: false),
(phoneme: 'n'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, 1, -1,
1, -1 ); isvowel: false),
(phoneme: 'c'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, -1,
1, -1, -1 ); isvowel: false),
(phoneme: 'x'; features: (-1, 1, 1, -1, -1, -1, -1, 0, 0, -1, 1, -1,
1 ); isvowel: false),
);

This wouldn't compile. What's wrong?

THANKS A LOT!!!

Amit


Jan Schnackenberg

2004-03-27, 12:20 am

Hi

First: How about setting a Followup-to while crossposting to this many
newsgroups?

Second: Remove the last "," and the Structure will compile just fine.

Ciao, Jan

--
/"\ ASCII RIBBON PS2-Assistent
\ / CAMPAIGN Antworten bitte ausschliesslich an die Newsgroup
X AGAINST HTML Links zu Delphi und dem verhalten in Newsgroups:
/ \ IN MAIL AND NEWS ---> http://www.fh-wedel.de/~snb/ <---
feardotcom

2004-03-27, 12:20 am


"Amit Layman" <amitlay77@hotmail.com> wrote in message
news:c0su90$5c3$1@news.iucc.ac.il...
> Hi!
>
> I'm trying to define a constant record this way:
>
> type
> TPhoneme = record
> phoneme: char;
> features: array [1..13] of integer;
> isvowel: boolean;
> end;
>
> TPhonemes = array [1..24] of TPhoneme;
>
> const
> PHONEMES: TPhonemes =
> (
> (phoneme: 'i'; features: ( 1, -1, 1, -1, -1, -1, -1, -1, 1, 0, 0,

0,
> 0 ); isvowel: true),
> (phoneme: 'e'; features: ( 1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0,

0,
> 0 ); isvowel: true),
> (phoneme: 'a'; features: ( 1, -1, -1, 1, 1, -1, -1, -1, 1, 0, 0, 0,
> 0 ); isvowel: true),
> (phoneme: 'u'; features: ( 1, -1, 1, 1, -1, -1, -1, 1, -1, 0, 0, 0,
> 0 ); isvowel: true),
> (phoneme: 'o'; features: ( 1, -1, -1, 1, -1, -1, -1, 1, 1, 0, 0,

0,
> 0 ); isvowel: true),
> (phoneme: 'y'; features: (-1, -1, 1, -1, -1, -1, -1, -1, -1, 0, 0,

0,
> 0 ); isvowel: false),
> (phoneme: 'r'; features: ( 1, 1, -1, -1, -1, -1, 1, 0, 0, 1,
> 1, -1, -1 ); isvowel: false),
> (phoneme: 'l'; features: ( 1, 1, -1, -1, -1, 1, 1, 0, 0, 1,
> 1, -1, -1 ); isvowel: false),
> (phoneme: 'h'; features: (-1, -1, -1, -1, 1, -1, -1, 0, 0, -1,
> 1, -1, -1 ); isvowel: false),
> (phoneme: 'p'; features: (-1, 1, -1, -1, -1, 1, -1, 0,
> 0, -1, -1, -1, -1 ); isvowel: false),
> (phoneme: 'b'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0,
> 1, -1, -1, -1 ); isvowel: false),
> (phoneme: 't'; features: (-1, 1, -1, -1, -1, 1, 1, 0,
> 0, -1, -1, -1, -1 ); isvowel: false),
> (phoneme: 'd'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0,
> 1, -1, -1, -1 ); isvowel: false),
> (phoneme: 'k'; features: (-1, 1, 1, 1, -1, -1, -1, -1,
> 0, -1, -1, -1, -1 ); isvowel: false),
> (phoneme: 'g'; features: (-1, 1, 1, 1, -1, -1, -1, -1, 0,
> 1, -1, -1, -1 ); isvowel: false),
> (phoneme: 'f'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, -1,

1, -1,
> 1 ); isvowel: false),
> (phoneme: 'v'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, 1,

1, -1,
> 1 ); isvowel: false),
> (phoneme: 'z'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, 1, 1, -1,
> 1 ); isvowel: false),
> (phoneme: 's'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, -1,

1, -1,
> 1 ); isvowel: false),
> (phoneme: 'S'; features: (-1, 1, 1, -1, -1, -1, 1, 0, 0, -1,

1, -1,
> 1 ); isvowel: false),
> (phoneme: 'm'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, 1, -1,
> 1, -1 ); isvowel: false),
> (phoneme: 'n'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, 1, -1,
> 1, -1 ); isvowel: false),
> (phoneme: 'c'; features: (-1, 1, -1, -1, -1, 1, 1, 0, 0, -1,
> 1, -1, -1 ); isvowel: false),
> (phoneme: 'x'; features: (-1, 1, 1, -1, -1, -1, -1, 0, 0, -1,

1, -1,
> 1 ); isvowel: false),
> );
>
> This wouldn't compile. What's wrong?
>
> THANKS A LOT!!!
>
> Amit
>
>

;
syntax is the root of all ev0l :)


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com