用DELPHI六开发的程序中 有一函数中有这么一个用法 SetLength(Result, 500); 这其中的 Result 是什么
用DELPHI6开发的程序中 有一函数中有这么一个用法 SetLength(Result, 500); 这其中的 Result 是什么 ?
function SelfPath: string;
begin
SetLength(Result, 500);
SetLength(Result, GetModuleFileName(HInstance, PChar(Result), 500));
Result := ExtractFilePath(Result);
end;
这其中的 Result 是什么 ?
------解决方案--------------------
function SelfPath: string;
Result就是返回值变量,类型就是String
function SelfPath: string;
begin
SetLength(Result, 500);
SetLength(Result, GetModuleFileName(HInstance, PChar(Result), 500));
Result := ExtractFilePath(Result);
end;
这其中的 Result 是什么 ?
------解决方案--------------------
function SelfPath: string;
Result就是返回值变量,类型就是String