map enum to field offsets (or create enum from field) typedef Person = ( string^ first, string^ last, string^ address, ); // alternative 1: create enum from struct (or map it) typedef FieldType = enum for Person; typedef FieldType = enum int for Person; typedef FieldType = enum int (first, last, address) for Person; // alternative 2: array that maps things to field offsets (string^, fieldof(Person))#[] fieldMap = [ ("First name", :first), ("Last name", :last), ("Address", :address), ];