Discussion:
HELP! PROBLEM WITH CONSTANT RECORD DECLARATION!!!
(too old to reply)
Amit Layman
2004-02-17 11:35:02 UTC
Permalink
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-02-17 11:58:58 UTC
Permalink
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-02-19 10:42:06 UTC
Permalink
Post by Amit Layman
Hi!
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,
Post by Amit Layman
0 ); isvowel: true),
(phoneme: 'e'; features: ( 1, -1, -1, -1, -1, -1, -1, -1, 1, 0, 0,
0,
Post by Amit Layman
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,
Post by Amit Layman
0 ); isvowel: true),
(phoneme: 'y'; features: (-1, -1, 1, -1, -1, -1, -1, -1, -1, 0, 0,
0,
Post by Amit Layman
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,
Post by Amit Layman
1 ); isvowel: false),
(phoneme: 'v'; features: (-1, 1, -1, -1, -1, 1, -1, 0, 0, 1,
1, -1,
Post by Amit Layman
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,
Post by Amit Layman
1 ); isvowel: false),
(phoneme: 'S'; features: (-1, 1, 1, -1, -1, -1, 1, 0, 0, -1,
1, -1,
Post by Amit Layman
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,
Post by Amit Layman
1 ); isvowel: false),
);
This wouldn't compile. What's wrong?
THANKS A LOT!!!
Amit
;
syntax is the root of all ev0l :)

Continue reading on narkive:
Loading...