Recent

Author Topic: difference static field vs. class var  (Read 2403 times)

Kays

  • Hero Member
  • *****
  • Posts: 614
  • Whasup!?
    • KaiBurghardt.de
difference static field vs. class var
« on: March 28, 2016, 09:32:20 pm »
Is there any difference beetween static fields and class variables?
Code: Pascal  [Select][+][-]
  1. unit myGreatUnit;
  2.  
  3. {$mode objfpc}
  4.  
  5. interface
  6.  
  7. type
  8.         TMyClass = class
  9.                 strict private
  10.                         // C L A S S
  11.                         // attributes
  12.                         foo: boolean; static;
  13.                         // variables
  14.                         class var
  15.                                 bar: boolean;
  16.         end;
  17.  
  18. implementation
  19.  
  20. end.
If so, what's the difference between them?
(Also, since when is {$static on} illegal? My old code uses it.)

EDIT: Never mind, the latest ref says it's equivalent. (I primarily use /usr/share/doc/fp-docs/* which in stable Debian is 2.6.4)
« Last Edit: March 28, 2016, 09:46:45 pm by Kays »
Yours Sincerely
Kai Burghardt

 

TinyPortal © 2005-2018