lunatik
asked on
Delphi Types.
I am new to delphi, however I am familiar to C++. I am trying to learn Delphi, but I can't find an equvalant for enum typedefs. Could someone please tell me what the equivalant is.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Read the help on "enumerated type"
example:
type
Suit = (Club, Diamond, Heart, Spade);
example:
type
Suit = (Club, Diamond, Heart, Spade);
That list didn't look too good in Arial. Sorry about that.
Alex
Alex
ASKER
What if the enum has something like
type
tdef = ( a = b, dog, cat);
the compiler gives an error for the a = b. What do you do in that instance.
type
tdef = ( a = b, dog, cat);
the compiler gives an error for the a = b. What do you do in that instance.
Raymond, that is basically what I said.
Alex
Alex
Humpf.
ASKER
Sorry. C and C++ is all I know. That is why I am trying to learn Delphi. It is just confusing trying to do the conversions. It does help thanks.
Jason
Jason
Simonet: Such timing! We both posted at 10:29. The funny thing is that when I posted my answer, your comment didn't come up, which is really strange as it appears your comment is before mine.
Perhaps EE needs to time posts to the second :-)
Cheers,
Raymond.
Perhaps EE needs to time posts to the second :-)
Cheers,
Raymond.
ASKER
hehehe. agreed
C type Pascal type
--------------------------
unsigned char byte
char char
char name[arSize] array [0..arSize - 1] of Char
int integer
unsigned int word
long longint
unsigned long longint
float single
double double
char far * PChar
char * PChar if large memory model, Word in small and medium
SomeType far * Var aName: SomeType
or PSomeType (type PSomeType = ^SomeType) if you
need the option to pass Nil as a value
struct record
union record with variants
enum enumerated type with compiler switch $Z+ set (default is $Z-!)
An Enum typedef is something like
Type
TMyEnum = (meEnum1, meEnum2, me Enum3);
Yours,
Alex
Athena's Place: http://www.bhnet.com.br/~simonet