Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Out parameter check

 Post Reply Post Reply
Author
Koistinen Mika View Drop Down
New Member
New Member
Avatar

Joined: 13 Oct 2010
Posts: 28
Post Options Post Options   Quote Koistinen Mika Quote  Post ReplyReply Direct Link To This Post Topic: Out parameter check
    Posted: 24 Nov 2016 at 3:11pm
variables with out parameters aren't checked. example bellow explains

procedure foo(const a: Integer; out b: Integer);
begin
  showmessage(b.ToString); //"uninitialized"
  b := somethingwith(a);
end;

var
  a,b: integeR;
begin
  a := 1;
  b := 1;  // not needed
  foo(a,b);
end;


Back to Top
Salmenius Jaakko View Drop Down
New Member
New Member
Avatar

Joined: 12 Nov 2017
Posts: 5
Post Options Post Options   Quote Salmenius Jaakko Quote  Post ReplyReply Direct Link To This Post Posted: 13 Nov 2017 at 1:03am
This would indeed be a good new check. Delphi compiler should check the out parameter (like C# does) but because it does not do that FixInsight should have a check for that.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down