Menu

Attribute for serialization

Anonymous
2014-12-22
2015-04-30
  • Anonymous

    Anonymous - 2014-12-22

    It would be nice to add attributes to serialize objects. There is a problem if the CML coincides with the reserved words.

    <product>
    <unit>шт</unit>
    </product>

    TProduct = class
    unit: string; // <--- error, reserved word
    end;

    TProduct = class
    [OName('Unit')]
    UnitName: string; // <--- translate

    [OIgnore]
    Code: integer; // no serialization
    end;

     
  • Ondrej Pokorny

    Ondrej Pokorny - 2015-01-07

    That's a good idea, I'll check the possibilities.

     
  • Ondrej Pokorny

    Ondrej Pokorny - 2015-04-30

    Sorry I didn't go into it earlier. For now, I suggest you take use of the '&' syntax to allow keywords in class and record definition.

    TProduct = class
    &unit: string; // <--- OK!
    end;

     

Anonymous
Anonymous

Add attachments
Cancel