You can read up on what 'Enum' types are and how they're used in the .NET framework. They are actually a more verbose and descriptive way of expressing an ordinal value (an integer). They also help the programmer avoid passing an incorrect numeric value that is not one of the values that's required.
For example, this is the definition of the PromptStatus enum type:
public enum PromptStatus
{
Cancel = -5002,
None = 5000,
Error = -5001,
Keyword = -5005,
OK = 5100,
Modeless = 5027,
Other
}
When you read code, you don't really want to have to look up what a given numeric argument represents, in cases where the argument must be one of a set of pre-determined values. For that reason, an integer can be used in lieu of an enum member, although doing so is unwise and almost universally accepted as a bad coding practice.
In your latest post, you use an integer in a call to Transaction.GetObject() rather than a member of the OpenMode enum, which makes it much more difficult to read and understand what the argument means.
@David_Prontnickiwrote:
Hi All,
Could someone explain to me this prompt status: If acSSet.Status = 5100 Then?
I am used to have prompt statuses similar to this: If acSSet.Status <> PromptStatus.OK Then.
I have never seen this before, I am working on something and came across it online while searching for something. I was just curious about it's meaning and use.
Thank you,
Dave