You can arrange your types in any order, doesn’t matter.
1 Like
Does this look acceptable? It compiles I’m mainly documenting this for those just starting on their journey of learning Oxygene - a hybrid between Object Pascal and .Net CLI languages. I sometimes don’t know when to use what from which language.
namespace SetOF_Oxy;
type
furniture = public enum(chair, desk, bed, wardrobe);
arrangement = set of furniture;
Program = class
public
class var myArrangement: arrangement := [furniture.chair, furniture.desk, furniture.bed,
furniture.wardrobe];
class method Main();
begin
writeLn("All available pieces of furniture: ");
for thing in myArrangement do
writeLn(thing);
readLn;
end; // Main
end; // class
end. // namespace
Looks good, yes.
The main take away form your original code was that you were trying to enumerate the type, not an instance of the type which might (or might not) contain some elements of the set.
1 Like