⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msdetect.inc

📁 borland c++ 4.0 用于学习ucos的
💻 INC
📖 第 1 页 / 共 2 页
字号:
        BadArgErr 1, "GetDayFromDate", szDate$
    end if
'$endif ''DEBUG
    GetDayFromDate = VAL(MID$(szDate$, 9, 2))
END FUNCTION


'*************************************************************************
FUNCTION GetHourFromDate (szDate$) STATIC  AS INTEGER
'$ifdef DEBUG
    if szDate = "" then
        BadArgErr 1, "GetHourFromDate", szDate$
    end if
'$endif ''DEBUG
    GetHourFromDate = VAL(MID$(szDate$, 12, 2))
END FUNCTION


'*************************************************************************
FUNCTION GetMinuteFromDate (szDate$) STATIC  AS INTEGER
'$ifdef DEBUG
    if szDate = "" then
        BadArgErr 1, "GetMinuteFromDate", szDate$
    end if
'$endif ''DEBUG
    GetMinuteFromDate = VAL(MID$(szDate$, 15, 2))
END FUNCTION


'*************************************************************************
FUNCTION GetSecondFromDate (szDate$) STATIC  AS INTEGER
'$ifdef DEBUG
    if szDate = "" then
        BadArgErr 1, "GetSecondFromDate", szDate$
    end if
'$endif ''DEBUG
    GetSecondFromDate = VAL(MID$(szDate$, 18, 2))
END FUNCTION


'*************************************************************************
FUNCTION GetVersionOfFile (szFile$) STATIC  AS STRING
'$ifdef DEBUG
    if FValidFATPath(szFile$) = 0 then
        BadArgErr 1, "GetVersionOfFile", szFile$
    end if
'$endif ''DEBUG
    cb% = 30
    szBuf$ = STRING$(cb%, 32)
    cbRet% = CbGetVersionOfFile(szFile$, szBuf$, cb%)
    GetVersionOfFile = szBuf$
'$ifdef DEBUG
    IF cbRet% >= cb% THEN
        StfApiErr saeOvfl, "GetVersionOfFile", szFile$
        ERROR STFERR
    END IF
'$endif ''DEBUG
    szBuf$ = ""
END FUNCTION


'*************************************************************************
FUNCTION GetVersionNthField (szVersion$, nField%) STATIC  AS LONG
'$ifdef DEBUG
    if (nField% < 1) OR (nField% > 4) then
        BadArgErr 2, "GetVersionNthField", szVersion$+", "+STR$(nField%)
    end if
'$endif ''DEBUG
    GetVersionNthField = LGetVersionNthField(szVersion$, nField%)
END FUNCTION


'*************************************************************************
FUNCTION GetSizeOfFile (szFile$) STATIC  AS LONG
'$ifdef DEBUG
    if FValidFATPath(szFile$) = 0 then
        BadArgErr 1, "GetSizeOfFile", szFile$
    end if
'$endif ''DEBUG
    GetSizeOfFile = LcbGetSizeOfFile(szFile$)
END FUNCTION


'*************************************************************************
FUNCTION FindTargetOnEnvVar (szFile$, szEnvVar$) STATIC  AS STRING
'$ifdef DEBUG
    if CchlValidFATSubPath(szFile$) = 0 then
        n% = 1
    elseif szEnvVar$ = "" then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
    end if
'$endif ''DEBUG

    cb% = 512
    szBuf$ = STRING$(cb%, 32)
    cbRet% = CbFindTargetOnEnvVar(szFile$, szEnvVar$, szBuf$, cb%)
    IF cbRet% >= cb% THEN
'$ifdef DEBUG
        StfApiErr saeOvfl, "FindTargetOnEnvVar", szFile$+", "+szEnvVar$
'$endif ''DEBUG
        ERROR STFERR
    END IF
    szBuf$ = RTRIM$(szBuf$)
    IF MID$(szBuf$, 1, 1) = "\" THEN
       szBuf$ = MID$(CURDIR$, 1, 2) + szBuf$
    ELSEIF Len(szBuf$) > 0 AND MID$(szBuf$, 2, 1) <> ":" THEN
       szBuf$ = MID$(CURDIR$, 1, 3) + szBuf$
    END IF
    FindTargetOnEnvVar = szBuf$
    szBuf$ = ""
END FUNCTION


'*************************************************************************
FUNCTION FindFileInTree (szFile$, szDir$) STATIC  AS STRING
'$ifdef DEBUG
    if CchlValidFATSubPath(szFile$) = 0 then
        n% = 1
    elseif FValidFATDir(szDir$) = 0 then
        n% = 2
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "FindFileInTree", szFile$+", "+szDir$
    end if
'$endif ''DEBUG

    cb% = 512
    szBuf$ = STRING$(cb%, 32)
    cbRet% = CbFindFileInTree(szFile$, szDir$, szBuf$, cb%)
    FindFileInTree = szBuf$
'$ifdef DEBUG
    IF cbRet% >= cb% THEN
        StfApiErr saeOvfl, "FindFileInTree", szFile$+", "+szDir$
        ERROR STFERR
    END IF
'$endif ''DEBUG
    szBuf$ = ""
END FUNCTION


'*************************************************************************
FUNCTION GetConfigSmartdrvSize STATIC  AS INTEGER
    GetConfigSmartdrvSize = WGetConfigSmartdrvSize
END FUNCTION


'*************************************************************************
FUNCTION GetConfigRamdriveSize STATIC  AS INTEGER
    GetConfigRamdriveSize = WGetConfigRamdriveSize
END FUNCTION


'*************************************************************************
FUNCTION GetConfigNumBuffers STATIC  AS INTEGER
    GetConfigNumBuffers = WGetConfigNumBuffers
END FUNCTION


'*************************************************************************
FUNCTION GetConfigNumFiles STATIC  AS INTEGER
    GetConfigNumFiles = WGetConfigNumFiles
END FUNCTION


'*************************************************************************
FUNCTION GetConfigLastDrive STATIC  AS STRING
    chRet% = WGetConfigLastDrive
    if chRet% = 0 then
        GetConfigLastDrive = ""
    else
        GetConfigLastDrive = CHR$(chRet%)
    end if
END FUNCTION


'*************************************************************************
FUNCTION IsDriverInConfig (szDrv$) STATIC  AS INTEGER
'$ifdef DEBUG
    if szDrv$ = "" then
        BadArgErr 1, "IsDriverInConfig", szDrv$
    end if
'$endif ''DEBUG
    IsDriverInConfig = FIsDriverInConfig(szDrv$)
END FUNCTION


'*************************************************************************
FUNCTION GetProcessorType STATIC  AS INTEGER
    GetProcessorType = 0
    longTmp& = GetWinFlags()
    IF longTmp& AND WF_CPU486 THEN
        GetProcessorType = 4
    ELSEIF longTmp& AND WF_CPU386 THEN
        GetProcessorType = 3
    ELSEIF longTmp& AND WF_CPU286 THEN
        GetProcessorType = 2
    ELSEIF longTmp& AND WF_CPU186 THEN
        GetProcessorType = 1
    END IF
END FUNCTION


'*************************************************************************
SUB GetParallelPortsList (szSymbol$) STATIC
'$ifdef DEBUG
    if szSymbol$ = "" then
        BadArgErr 1, "GetParallelPortsList", szSymbol$
    end if
'$endif ''DEBUG
    if FGetParallelPortsList(szSymbol$) = 0 then
'$ifdef DEBUG
        StfApiErr saeFail, "GetParallelPortsList", szSymbol$
'$endif ''DEBUG
        ERROR STFERR
    end if
END SUB


'*************************************************************************
SUB GetSerialPortsList (szSymbol$) STATIC
'$ifdef DEBUG
    if szSymbol$ = "" then
        BadArgErr 1, "GetSerialPortsList", szSymbol$
    end if
'$endif ''DEBUG
    if FGetSerialPortsList(szSymbol$) = 0 then
'$ifdef DEBUG
        StfApiErr saeFail, "GetSerialPortsList", szSymbol$
'$endif ''DEBUG
        ERROR STFERR
    end if
END SUB


'*************************************************************************
FUNCTION Has87MathChip STATIC  AS INTEGER
    Has87MathChip = FHas87MathChip
END FUNCTION


'*************************************************************************
FUNCTION HasMonochromeDisplay STATIC  AS INTEGER
    HasMonochromeDisplay = FHasMonochromeDisplay
END FUNCTION


'*************************************************************************
FUNCTION HasMouseInstalled STATIC  AS INTEGER
    HasMouseInstalled = FHasMouseInstalled
END FUNCTION


'*************************************************************************
FUNCTION DoesDirExist (szDir$) STATIC  AS INTEGER
'$ifdef DEBUG
    if FValidFATDir(szDir$) = 0 then
        BadArgErr 1, "DoesDirExist", szDir$
    end if
'$endif ''DEBUG
    DoesDirExist = FDirExists(szDir$)
END FUNCTION


'*************************************************************************
FUNCTION DoesIniSectionExist (szFile$, szSect$) STATIC  AS INTEGER
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        BadArgErr 1, "DoesIniSectionExist", szFile$+", "+szSect$
    end if
'$endif ''DEBUG
    DoesIniSectionExist = FDoesIniSectionExist(szFile$, szSect$)
END FUNCTION


'*************************************************************************
FUNCTION DoesIniKeyExist (szFile$, szSect$, szKey$) STATIC  AS INTEGER
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        n% = 1
    elseif szKey$ = "" then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "DoesIniKeyExist", szFile$+", "+szSect$+", "+szKey$
    end if
'$endif ''DEBUG

    DoesIniKeyExist = FDoesIniKeyExist(szFile$, szSect$, szKey$)
END FUNCTION


'*************************************************************************
FUNCTION GetIniKeyString (szFile$, szSect$, szKey$) STATIC  AS STRING
'$ifdef DEBUG
    if FValidIniFile(szFile$) = 0 then
        n% = 1
    elseif szKey$ = "" then
        n% = 3
    else
        n% = 0
    end if
    if n% > 0 then
        BadArgErr n%, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
    end if
'$endif ''DEBUG

    cb% = 512
    szBuf$ = STRING$(cb%, 32)
    cbRet% = CbGetIniKeyString(szFile$, szSect$, szKey$, szBuf$, cb%)
    GetIniKeyString = szBuf$
'$ifdef DEBUG
    IF cbRet% >= cb% THEN
        StfApiErr saeOvfl, "GetIniKeyString", szFile$+", "+szSect$+", "+szKey$
        ERROR STFERR
    END IF
'$endif ''DEBUG
    szBuf$ = ""
END FUNCTION



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -