开发者

Delphi: Return value might be undefined, despite setting it after begin

can anyone tell me why I get "Return value ... might be undefined" here:

function TXMLAcceptorBCOLSubmission.createRecordsInBCFEEPAR(AXML: TRipX开发者_运维技巧MLElement): String;
var
  ...
begin
  Result := '';


I am using Delphi 5 and it looks like the problem is caused by declaring more than 30 variables (I know, I know). It doesn't seem to matter what they are called or what types they are.


Following code doesn't generate a warning using Delphi 5 so

  • either it is a bug in an other Delphi version (you should mention the version you use)
  • or either it is something you didn't show us yet.

Code

program ProveAPoint;
{$APPTYPE CONSOLE}
uses SysUtils;

type
  TRipXMLElement = record
  end;
  TXMLAcceptorBCOLSubmission = class
  public
    function createRecordsInBCFEEPAR(AXML: TRipXMLElement): string;
  end;

function TXMLAcceptorBCOLSubmission.createRecordsInBCFEEPAR(AXML: TRipXMLElement): String;
begin
  Result := '';
end;

var
  AXML: TRipXMLElement;
begin
  with TXMLAcceptorBCOLSubmission.Create do
  begin
     createRecordsInBCFEEPAR(AXML);
     Free;
  end;
end.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜