* * *

Author Topic: Possible bug  (Read 866 times)

darksky666

  • New member
  • *
  • Posts: 38
Possible bug
« on: July 25, 2018, 02:49:48 pm »
From Documentation on $COPERATORS

"By default, these assignments are not allowed"

I am using FPC 3.0.4, it allows those operators without that compiler directive. Only with that {$COPERATORS OFF} does it throw an error.

https://s8.postimg.cc/rl0b6udgl/Untitled.png


Typing mistake/s in Reference Manual:


Quote from: Reference Manual - Page 170
Additionally, the is operator can be used to check if a class implements an interface, and the varas operator can be used to typecast an interface back to the class:

Quote from: Reference Manual - Page 233
Free Pascal supports making of dynamic libraries (DLLs under Win32 and OS/2) trough the use of the Library keyword
« Last Edit: July 25, 2018, 03:18:30 pm by darksky666 »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6540
Re: Possible bug
« Reply #1 on: July 25, 2018, 03:04:19 pm »
Compiler modes are a bundle of smaller options (like Coperator), so probably mode objfpc turns  coperators on. (try mode delphi)

I fixed the two spelling errors in docs SVN, thank you

Thaddy

  • Hero Member
  • *****
  • Posts: 6904
Re: Possible bug
« Reply #2 on: July 25, 2018, 03:05:19 pm »
In mode obfpc (as opposed to mode fpc, which is the default) coperators are always ON. So regarding that the documentation is correct.
You can file a bug report against documentation to resolve the spelling mistakes (I did the previous one for you).
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

Thaddy

  • Hero Member
  • *****
  • Posts: 6904
Re: Possible bug
« Reply #3 on: July 25, 2018, 03:06:25 pm »
Compiler modes are a bundle of smaller options (like Coperator), so probably mode objfpc turns  coperators on. (try mode delphi)

I fixed the two spelling errors in docs SVN, thank you
Marco, our posts crossed: thanks for fixing!
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

darksky666

  • New member
  • *
  • Posts: 38
Re: Possible bug
« Reply #4 on: July 25, 2018, 03:07:39 pm »
Oh! okay, thanks ..

darksky666

  • New member
  • *
  • Posts: 38
Re: [SOLVED] Possible bug
« Reply #5 on: July 25, 2018, 03:15:40 pm »
I just tried Delphi and FPC mode, both of them compiled fine too (without COPERATORS ON directive)! Can anyone else please check it and confirm it..
« Last Edit: July 25, 2018, 03:56:33 pm by darksky666 »

Thaddy

  • Hero Member
  • *****
  • Posts: 6904
Re: Possible bug
« Reply #6 on: July 25, 2018, 06:42:30 pm »
Why?  I actually and usually add an example that is compilable. (As opposed to nitwits that shout they are right).
Not to make too fine a point about that.... <not grumpy to you, but to the nitwits: >:D >:D >:D >:D>
You may be misinformed if you ignore my advice.

For such a simple issue I only work on demand.
« Last Edit: July 25, 2018, 07:00:56 pm by Thaddy »
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6540
Re: Possible bug
« Reply #7 on: July 25, 2018, 08:52:18 pm »
He is right though.  i+=1 also works in mode delphi.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus