Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2019-09

Reserved words in OLE automation properties

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Werner Pamler

I am porting an older Delphi project to Lazarus/FPC which analyzes the internal structure of PowerPoint files using OLE automation. While the overall program is working I am stuck with some OLE properties which have the name of Pascal keywords, e.g. Shape.*Type *or ColorEffect.*To*.

FPC 3.0.4 and trunk refuse to compile lines like

     DisplayValue('Type', MsoShapeTypeStr(AShape.Type), true);

even if {$MODE DELPHI} is used. AShape is an OLEVariant, MsoShapeTypeStr a function which converts the integer value of AShape.Type to a string. The error message is 'Fatal: Syntax error, "identifier" expected but "TYPE" found'.

Any idea how I could make this work?

Reply by email

Michael Van Canneyt
to Werner Pamler
Werner Pamler wrote 15 lines
I am porting an older Delphi project to Lazarus/FPC which analyzes the internal structure of PowerPoint files using OLE automation. While the overall program is working I am stuck with some OLE properties which have the name of Pascal keywords, e.g. Shape.*Type *or ColorEffect.*To*. FPC 3.0.4 and trunk refuse to compile lines like     DisplayValue('Type', MsoShapeTypeStr(AShape.Type), true); even if {$MODE DELPHI} is used. AShape is an OLEVariant, MsoShapeTypeStr a function which converts the integer value of AShape.Type to a string. The error message is 'Fatal: Syntax error, "identifier" expected but "TYPE" found'. Any idea how I could make this work?

AShape.&Type

should do the trick, no ?

Michael.

Reply by email

gabor
to Werner Pamler: I am porting an older Delphi project to Lazarus/FPC which analyzes the internal structure…

if I remember correctly use '&' as preffix, eg: MyObj.&Type

W dniu 2019-09-28 o 18:50, Werner Pamler pisze:

Show quoted text 20 lines
I am porting an older Delphi project to Lazarus/FPC which analyzes the internal structure of PowerPoint files using OLE automation. While the overall program is working I am stuck with some OLE properties which have the name of Pascal keywords, e.g. Shape.*Type *or ColorEffect.*To*. FPC 3.0.4 and trunk refuse to compile lines like     DisplayValue('Type', MsoShapeTypeStr(AShape.Type), true); even if {$MODE DELPHI} is used. AShape is an OLEVariant, MsoShapeTypeStr a function which converts the integer value of AShape.Type to a string. The error message is 'Fatal: Syntax error, "identifier" expected but "TYPE" found'. Any idea how I could make this work? _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email