Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:56:45+00:00 2026-05-22T23:56:45+00:00

Working on a console application using Delphi 7, and have run into a problem.

  • 0

Working on a console application using Delphi 7, and have run into a problem. I get an error on line 26 after

str := GetEnumName(TypeInfo (words[3].group),

The error reads “[Error] Project1.dpr(26): TYPEINFO standard function expects a type identifier” if anyone could help with this, it would be a great help!

Cheers!

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.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:56:46+00:00Added an answer on May 22, 2026 at 11:56 pm

    You are trying to pass there an enumeration field not a type identifier. You need to declare this enumeration separately (what is in the example below TGroup type).

    Anyway there is an unwritten convention to use T prefix for each Type identifier so then you can easy recognize a Type. That’s the reason why I renamed Wordset to TWordset. Also word is not a good name for fields or variables because it’s also a data type in Delphi.

    program Project1;
    
    {$APPTYPE CONSOLE}
    
    uses SysUtils, TypInfo;
    
    type
      TGroup = (Flavour, Color, Place, Animal);
    
    type
      TWordset = record
        Name: string;
        Group: TGroup;
      end;
    
    var
      Str: string;
      Words: array [1..50] of TWordset;
    
    begin
      Words[1].Name  := 'Vanilla';
      Words[1].Group := Flavour;
      Words[2].Name  := 'Green';
      Words[2].Group := Color;
      Words[3].Name  := 'Home';
      Words[3].Group := Place;
      Words[4].Name  := 'Cat';
      Words[4].Group := Animal;
    
      Str := GetEnumName(TypeInfo(TGroup), Integer(Words[3].Group));
    
      Writeln(Str);
      Readln;
    end.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a console application, that receives a pretty long list of
I'm currently working on a console application that will pass a vcxproj file and
I'm working on a interactive python shell for an application using Qt. However I
I've a program working as client and server. I'm using wcf services with BasicHttpBinding
I followed the steps here to make my existing WCF service (already working fine
Well m searching hard on google but unable to find any working code that
I am working on making my client open another program by downloading the bytes
I'm working on a project in Java, which is communicating with two serial port
I'm working on an open source project (Logbus-ng), and I need to implement a
I recently obtained a license for WinX DVD Ripper Platinum, and am annoyed by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.