Recent

Author Topic: Small error in Reference Manual  (Read 1018 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: 7195
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 »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

Thaddy

  • Hero Member
  • *****
  • Posts: 7195
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 »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.

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 »