procedure 没有Result;
function 有.

解决方案 »

  1.   

    除非你在procedure中写了Result,在function中应该不会出现这种情况
      

  2.   

    那應該如何寫?我是照教程做的.
    [函式原型]
    function _GetOSVer:string;
    var OSVersionInfo: TOSVersionInfo;
      MajVerStr,
      MinVerStr,
      BuildNoStr,
      PlatFormStr,
      CSDVerStr: string;
    begin
     Result := ''; OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
     if not GetVersionEx(OSVersionInfo) then Exit; with OSVersionInfo do
        begin
         case dwPlatFormId of
             VER_PLATFORM_WIN32s: PlatFormStr := 'Win32s';
             VER_PLATFORM_WIN32_WINDOWS: PlatFormStr := 'Windows 9X';
             VER_PLATFORM_WIN32_NT: PlatFormStr := 'Windows NT';
         end;     MajVerStr := IntToStr (dwMajorVersion);
         MinVerStr := IntToStr (dwMinorVersion);
         BuildNoStr := IntToStr (dwBuildNumber and $0000FFFF); // low order word
         CSDVerStr := StrPas (szCSDVersion);    end; Result := PlatFormStr + ' ' +
     MajVerStr + '.' +
     MinVerStr + ' ' + '(Build ' +
     BuildNoStr + ':' +
     CSDVerStr + ')';end;