Working with a console application using Delphi 7, and there was a problem. I get an error on line 26 after
str: = GetEnumName (TypeInfo (words [3] .group),
The error is being read "[Error] Project1.dpr (26): the standard function TYPEINFO expects an identifier like" if someone can help with this, this will be a big help!
Hooray!
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils,
TypInfo;
type
wordset = Record
word : String;
group : (flavour, colour, place, animal);
end;
Var
words : Array [1..50] of wordset;
str : string;
groups: string;
Begin
words[1].word := 'chocolate';
words[1].group := flavour;
words[2].word := 'vanilla';
words[2].group := flavour;
words[3].word := 'strawberry';
words[3].group := flavour;
str := GetEnumName(TypeInfo (words[3].group), integer(group));
readln;
end.
source
share