* * *

Author Topic: Small error in Reference Manual  (Read 707 times)

darksky666

  • New member
  • *
  • Posts: 38
Small error in Reference Manual
« on: July 21, 2018, 05:43:03 am »
Reference Manual (3.0.4) - (Page 132) Extended Records  - TTest4 example has a protected visibility modifier in it.

Thaddy

  • Hero Member
  • *****
  • Posts: 6904
Re: Small error in Reference Manual
« Reply #1 on: July 21, 2018, 11:07:49 am »
There are actually small errors
Code: Pascal  [Select]
  1. type
  2. TTest4 = record  
  3.  private  
  4.    a : Integer;  
  5.    function getp : integer;  
  6.  public  
  7.    b : string;  
  8.    procedure setp (const aValue : integer);  
  9.    property p : integer read Getp Write SetP;  
  10.  public  
  11.  case x : integer of  
  12.    1 : (Q : string[255]); // can't use reference counted strings in a variant record . Compiler will give error on refcounted strings
  13.    2 : (S : String[255]); // can't use reference counted strings in a variant record  
  14.  end;
  15.  
  16.  function TTest4.getp : integer;  
  17.  begin
  18.    Result := a;
  19.  end;
  20.  procedure TTest4.setp (const aValue : integer);  
  21.  begin
  22.    a :=aValue;
  23.  end;
  24.  
  25. begin
  26. end.
I will file a bug report.
[edit]
reported as Bug report 0034015


« Last Edit: July 21, 2018, 11:20:53 am by Thaddy »
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

Thaddy

  • Hero Member
  • *****
  • Posts: 6904
Re: Small error in Reference Manual
« Reply #2 on: July 21, 2018, 04:16:34 pm »
@darksky666
And it is now already fixed in trunk!
As Michael wrote in the report: well spotted!
« Last Edit: July 21, 2018, 04:19:49 pm by Thaddy »
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

darksky666

  • New member
  • *
  • Posts: 38
Re: Small error in Reference Manual
« Reply #3 on: July 22, 2018, 01:54:15 pm »
Oh wow, thanks for reporting it, .. also I think I found a typo:

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:"

I think that it was supposed to be just "as operator"? It isn't really an issue tbh though..
« Last Edit: July 22, 2018, 02:08:06 pm by darksky666 »

 

Recent

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