Page 1 of 1

Allow named Enumerations as valid integer data type.

Posted: Mon Aug 11, 2014 10:27 pm
by skywalk
I come across this when interfacing with c libraries.

Code: Select all

Enumeration my_enum
  #my_enum1 = $0
  #my_enum2 = $1
EndEnumeration
Structure My_struc
  x.d
  y.i         ;<-- Instead of using .i, allow Enum as valid integer data type.
  ;y.My_enum  ;<-- Since Enum's are integer anyway.
              ;<-- Instead of "Error - Structure not found."
EndStructure
Structure My_strucu
  x.d
  StructureUnion
    y_my_enum1.i  
    y_my_enum2.i  ;<-- with y_my_enum1 & 2, trigger an autocomplete fill with '='
  EndStructureUnion
EndStructure
Define.My_struc mys
Define.My_strucu mysu
Debug SizeOf(My_struc)
Debug SizeOf(My_strucu)
mysu\y_my_enum1 = #my_enum1 ;<-- Instead of creating this mnemonic to fill auotcomplete #My_enum1 & #My_enum2.
mys\y           = #my_enum1
;...............^ Trigger autocomplete to only show #my_enum1 & #my_enum2 on press of '=' sign.

Re: Allow named Enumerations as valid integer data type.

Posted: Mon Aug 11, 2014 11:35 pm
by idle
+1
Adding a typedef system would greatly ease the porting and handle enumerations as well