Board index » delphi » OLE property is a reserved word (newbie)

OLE property is a reserved word (newbie)

Hullo group,

I am sorry for not knowing such a simple thing, but .....

Using the ACT! OLE SDK, I have an object (IDispatch) called Fields.  One of
the properties of this object is called Label.  Label takes parameters (1)
an integer index, and (2) optionally a string value, the new label for the
selected field.

Problem of course is that Label is a reserved word!  Delphi won't let me
write

    AString := MyObject.Fields.Label[AIndex];

Is there a "GetLabel" kind of accessor function or something I can use to
get round this?

Please help.

John M. Kerr.

 

Re:OLE property is a reserved word (newbie)


Is MyObject declared as variant or olevariant? If yes, this should compile
and run fine.

If, instead, you're using early binding, Delphi will normally rename it to
Label_. So your early binding syntax would probably be:

MyObject.Fields.Label_ [AIndex, EmptyParam];

have fun
--
Binh Ly
Visit my COM Notes at http://www.castle.net/~bly/com

Quote
John Kerr <ke...@gaelquality.co.uk> wrote in message

news:7s5g16$5ni7@forums.borland.com...
Quote
> Hullo group,

> I am sorry for not knowing such a simple thing, but .....

> Using the ACT! OLE SDK, I have an object (IDispatch) called Fields.  One
of
> the properties of this object is called Label.  Label takes parameters (1)
> an integer index, and (2) optionally a string value, the new label for the
> selected field.

> Problem of course is that Label is a reserved word!  Delphi won't let me
> write

>     AString := MyObject.Fields.Label[AIndex];

> Is there a "GetLabel" kind of accessor function or something I can use to
> get round this?

> Please help.

> John M. Kerr.

Other Threads