I have the following enum in Delphi:
type TChangingDataSetState=(Inserting=1,Editing,Deleting)
......
var
ChangingDSSsate:TChangingDataSetState;
In BeforePost event I check if the dataset in Insert mode then I
ChangingDSState:=Inserting
else
ChagingDSState:=Editing
Let’s say the dataset is in edit mode, it means my ChangingDSState var will get evuluated to 2(Editing). Now I want to know how I can then use that number to pass it as an argument to a procedure
I assume you want the ordinal value rather than the enumerated value. You get that with
ord().So,
ord(ChagingDSState)is an integer expression with a value of2whenChagingDSStateequalsEditing.