Jump to content
Ian Branch

TypeInfo Issue..

Recommended Posts

Hi Team,

Delphi 12.2.

I have the following line:

  ShowMessage('State: ' + System.TypeInfo.GetEnumName(TypeInfo(TDataSetState), Ord(APD.State)) + '.  Job # = ' + IntToStr(APD.JobNo));

I tried adding System.TypeInfo to the uses clause but Delphi complains it can't compile it.

The issue I have here with this line of code is that Delphi tells me it expects a '(' but found a ',' after the TypeInfo.

I checked the code at https://docwiki.embarcadero.com/CodeExamples/Athens/en/TypInfoGetEnumName_(Delphi) and I am consistant with it.

Have I missed something or is this a bug?

 

Regards & TIA,

Ian

 

Share this post


Link to post
26 minutes ago, havrlisan said:

You've got a typo: it's not System.TypeInfo, it's System.TypInfo

Doh!  Well, isn't that counter intuitive...

Speaks volumes about how we 'journalise' when we read..

Thank you.  All sorted now.

Regards,

Ian

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×