Recent

Author Topic: OleVariant - problem with the name operator  (Read 2646 times)

romerws

  • Newbie
  • Posts: 2
OleVariant - problem with the name operator
« on: May 13, 2019, 03:27:00 pm »
Lazarus 1.4.2
FPC 2.6.4

A piece of code:

Code: Pascal  [Select][+][-]
  1. procedure ole_test;
  2. var oleObject: OleVariant;
  3.  
  4. begin
  5.   ...
  6.   oleObject.Operator := 'WS';  // Fatal: Syntax error, "identifier" expected but "OPERATOR" found
  7.   ...
  8. end;  
  9.  
What to do?
Thanks

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: OleVariant - problem with the name operator
« Reply #1 on: May 13, 2019, 08:28:30 pm »
You could try
Code: Pascal  [Select][+][-]
  1. oleObject.&Operator := 'WS';
I don't have Windows, so I have not tried this myself.

ASBzone

  • Hero Member
  • *****
  • Posts: 678
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: OleVariant - problem with the name operator
« Reply #2 on: May 13, 2019, 08:38:21 pm »
You could try
Code: Pascal  [Select][+][-]
  1. oleObject.&Operator := 'WS';
I don't have Windows, so I have not tried this myself.

I tried this suggestion and it compiles without issues (in both delphi and objfpc modes)

The original compiles without issues if {$mode delphi} is enabled.
-ASB: https://www.BrainWaveCC.com/

Lazarus v2.2.7-ada7a90186 / FPC v3.2.3-706-gaadb53e72c
(Windows 64-bit install w/Win32 and Linux/Arm cross-compiles via FpcUpDeluxe on both instances)

My Systems: Windows 10/11 Pro x64 (Current)

romerws

  • Newbie
  • Posts: 2
Re: OleVariant - problem with the name operator
« Reply #3 on: May 14, 2019, 08:14:07 am »
It helped :-) Thank you very much.

 

TinyPortal © 2005-2018