Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-05

int64 assignment fails

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tom Lisjac

fpc-2.6.4-1.x86_64. says "Argument can't be assigned to" when trying to compile the following:

type
  TickType = Int64;
  TimebaseData = record
    TicksFrequency: TickType;
  end;
  TEpikTimer= class(TComponent)
    private
      FHWTicks:TimeBaseData;
    Public
      property HWTimebase: TimeBaseData read FHWTicks write FHWTicks;
  TForm1 = class(TForm);
    public
      ET:TEpikTimer;
  procedure TForm1.Button8CLICK(Sender: TObject);
   begin
      ET.HWTimebase.TicksFrequency:=10; // Fails

This used to compile and seems like a straightforward int64 assignment. Has something changed where this is no longer allowed?

Thanks,

-Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140510/03c24473/attachment.html>

Reply by email

Flávio Etrusco
to Tom Lisjac
Tom Lisjac wrote 30 lines
fpc-2.6.4-1.x86_64. says "Argument can't be assigned to" when trying to compile the following: type TickType = Int64; TimebaseData = record TicksFrequency: TickType; end; TEpikTimer= class(TComponent) private FHWTicks:TimeBaseData; Public property HWTimebase: TimeBaseData read FHWTicks write FHWTicks; TForm1 = class(TForm); public ET:TEpikTimer; procedure TForm1.Button8CLICK(Sender: TObject); begin ET.HWTimebase.TicksFrequency:=10; // Fails This used to compile and seems like a straightforward int64 assignment. Has something changed where this is no longer allowed? Thanks, -Tom

Yes, this used to compile, but was changed/fixed in FPC 2.2 or something - I guess because of the "property contract": code shouldn't break if you change your property to have a getter instead of direct field access.

Best regards,
Fl?vio

Reply by email

Tom Lisjac
to leledumbo

That was it... many thanks to you and Flavio!

-Tom

leledumbo wrote 16 lines

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140511/1af20577/attachment.html>

Reply by email