[Progress Communities] [Progress OpenEdge ABL] Automatically cast Enums in assignment to database fields and vice versa

  • Thread starter Thread starter Simon L. Prinsloo
  • Start date Start date
Status
Not open for further replies.
S

Simon L. Prinsloo

Guest
Database field cannot be ENUM types, so to store an ENUM, it must be one of STRING, INTEGER or INT64. When assigning an ENUM instance to a database field or a temp-table field automatically cast to the expected type. When assigning a STRING, INTEGER or INT64 database field or temp-table field to a variable of an ENUM type, automatically cast to an ENUM. This is not needed for variable and property assignments, as they should ideally be defined as the ENUM type, but the simplest change (i.e. always cast or only cast when using buffers) is good enough. In other word, instead of code like this: ASSIGN Order.orderStatus = INT(OrderStatusEnum:Shipped) .... ASSIGN oMyEnum = OrderStatusEnum:GetEnum(Order.orderStatus) Allow the code to be like this: ASSIGN Order.orderStatus = OrderStatusEnum:Shipped .... ASSIGN oMyEnum = Order.orderStatus

Continue reading...
 
Status
Not open for further replies.
Back
Top