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 of 2
when ChagingDSState
equals Editing
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With