Using a indentifier or reserved word in a automation object under FPC

大兔子大兔子 提交于 2019-12-10 19:51:28

问题


Actually i am using OLE automation under Free Pascal , but some objects have properties which uses reserverd words as names, so i cannot compile the code.

check this sample

  MyObj : OleVariant;
begin
  MyObj := CrealeOleObject('AObject');
  MyObj.Descriptor   := Param1;
  MyObj.Type            := Param2;  //this line  generates a error

this is the error

StdOleAux.pas(783,15) Fatal: Syntax error, "identifier" expected but "TYPE" found

so the question is how i can access this properties in FPC when they have a name which is a reserved word?

FPC 2.2.4

Lazarus 0.9.28.2

using {$MODE DELPHI}


回答1:


You need version '2.5.1' of FPC, see the report "Allow Extended Identifiers in the Delphi mode" which has been resolved as fixed at 2010-03-22.



来源:https://stackoverflow.com/questions/4501090/using-a-indentifier-or-reserved-word-in-a-automation-object-under-fpc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!