Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

EConvertError "$"

  Alt 25. Apr 2009, 20:33
Ich bekomme diese Meldung seit 2009.

"$" ist kein gültiger integer wert.

Delphi-Quellcode:
var
GetSys : Integer;
...
GetSys := GetOperatingSystem;
Delphi-Quellcode:
unit uSysInfo;

interface
  uses windows, SysUtils, Messages ;

const
  { operating system (OS)constants }
  cOsUnknown = -1;
  cOsWin95 = 0;
  cOsWin98 = 1;
  cOsWin98SE = 2;
  cOsWinME = 3;
  cOsWinNT = 4;
  cOsWin2000 = 5;
  cOsXP = 6;
  cOsVista = 7;

function GetOperatingSystem: Integer;

implementation

function GetOperatingSystem: Integer;
var
  osVerInfo: TOSVersionInfo;
  majorVer, minorVer: Integer;
begin

  { set operating system type flag }
  osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
  if GetVersionEx(osVerInfo) then
  begin
    majorVer := osVerInfo.dwMajorVersion;
    minorVer := osVerInfo.dwMinorVersion;
    case osVerInfo.dwPlatformId of
      VER_PLATFORM_WIN32_NT: { Windows NT/2000 } 
        begin
          if majorVer <= 4 then
            Result := cOsWinNT
          else if (majorVer = 5) and (minorVer = 0) then
            Result := cOsWin2000
          else if (majorVer = 5) and (minorVer = 1) then
            Result := cOsXP
          else if (majorVer = 6) and (minorVer = 0) then
            Result := cOsVista
          else
            Result := cOsUnknown;
        end;
      VER_PLATFORM_WIN32_WINDOWS: { Windows 9x/ME }
        begin
          if (majorVer = 4) and (minorVer = 0) then
            Result := cOsWin95
          else if (majorVer = 4) and (minorVer = 10) then
          begin
            if osVerInfo.szCSDVersion[1] = 'Athen
              Result := cOsWin98SE
            else
              Result := cOsWin98;
          end
          else if (majorVer = 4) and (minorVer = 90) then
            Result := cOsWinME
          else
            Result := cOsUnknown;
        end;
      else
        Result := cOsUnknown;
    end;
  end
  else
    Result := cOsUnknown;
end;

end.
Das problem hatte ich unter 2006 nicht
Kann mir jemand sagen wo das problem liegt ?

Kann da keinen Fehler entdecken.

gruss Emil
  Mit Zitat antworten Zitat