home *** CD-ROM | disk | FTP | other *** search
- STATIC DEFINE CALL_PROC :=2
- STATIC DEFINE CUR_PROC :=1
- STATIC DEFINE FILE_ERRORLOG :="VOERROR.LOG"
-
- STATIC DEFINE TXT_SEP :=" "
-
- STATIC DEFINE TXT_VERSION:="LB 03/28/94"
-
- STATIC FUNCTION DefError(oError AS OBJECT) AS USUAL PASCAL
-
- LOCAL DIM awButton[3] AS WORD
- LOCAL wChoice AS WORD
- LOCAL cTitel AS STRING
- LOCAL cMessage AS STRING
- LOCAL lErrorLog AS LOGIC
- LOCAL cFileErrorLog AS STRING
- LOCAL siFEL AS SHORTINT
- LOCAL siI AS SHORTINT
- LOCAL cDiskName AS STRING
- LOCAL cCurDiskName AS STRING
- LOCAL lOsError AS LOGIC
- LOCAL siFError, siDOSError AS SHORTINT
- LOCAL cBuffer AS STRING
- LOCAL aDynStack AS ARRAY
- LOCAL siDynStack AS SHORTINT
- LOCAL dwFilePos AS DWORD
- LOCAL pszDrive AS PSZ
- LOCAL lDangerous AS LOGIC
- LOCAL strucMArgs AS _MARGS
- LOCAL aArgs AS ARRAY
- LOCAL wCount, wI, wJ AS WORD
- LOCAL oSelf AS OBJECT
- LOCAL p AS PTR
- LOCAL symIVar AS SYMBOL
- LOCAL cMessageLine1 AS STRING
- LOCAL cMessageLine3 AS STRING
- LOCAL cMessageLine5 AS STRING
- LOCAL cFormat AS STRING
-
- STATIC LOCAL wDefError AS WORD
-
- ~"PROCLINE+"
- ~"PROCNAME+"
-
- IF .NOT. IsInstanceOf(oError, #ERROR)
- ClearStrucErrInfo()
- strucErrInfo.wGenCode := EG_WRONGCLASS
- strucErrInfo.wSeverity := ES_ERROR
- strucErrInfo.symFuncSym := #DefError
- strucErrInfo.pszArg := AsPsz(oError)
- strucErrInfo.wArgNum := 1
- strucErrInfo.lCanDefault := .T.
- oError :=ErrorBuild(@strucErrInfo)
- ENDIF
-
- IF oError:CanDefault
- IF oError:GenCode = EG_OPEN .AND.;
- oError:OsCode = 32
- NetErr(.T.)
- RETURN E_DEFAULT
- ENDIF
-
- IF oError:GenCode = EG_APPENDLOCK
- NetErr(.T.)
- RETURN E_DEFAULT
- ENDIF
- ENDIF
-
- IF ++wDefError >=3
- _IError(oError:GenCode, .T., __CavoStr(__CAVOSTR_SYSLIB_ERR_IN_ERR))
- ELSEIF wDefError >=2
- p :=_MAKEPTR(_SS, 0x56)
- WORD(p) :=2
- ENDIF
-
- siFError :=FError()
- siDOSError :=DOSError()
-
- IF SetBeep()
- Tone(440, 1)
- Tone(494, 1)
- Tone(523, 1)
- ENDIF
-
- IF oError:GenCode = EG_MEM
- ELSE
- DynLock()
- ENDIF
-
- IF oError:CanDefault .OR. oError:CanSubstitute
- awButton[1] := SE_IGNORE
- ENDIF
- IF oError:CanRetry
- IF oError:GenCode = EG_NOVAR
- oError:CanRetry :=.F.
- ELSE
- awButton[2] := SE_RETRY
- ENDIF
- ENDIF
-
-
-
- awButton[3] := IIF(CanBreak(), SE_CANCEL +SE_DEFAULT, SE_ABORT +SE_DEFAULT)
-
-
- ;
-
-
- cTitel := __CavoStr(__CAVOSTR_SYSLIB_MODULE)
- cMessageLine1 := VO_SPrintF(cTitel, ProcFile(CUR_PROC) +" ")
-
- ;
-
- cTitel := __CavoStr(__CAVOSTR_SYSLIB_ENTITY)
- cMessageLine3 := VO_SPrintF(cTitel, ProcName(CUR_PROC) +" ")
- IF ProcLine(CUR_PROC) <>0
- cTitel := __CavoStr(__CAVOSTR_SYSLIB_LINE)
- cMessageLine5 := VO_SPrintF(cTitel, " " + NTrim(ProcLine(CUR_PROC)))
- ENDIF
-
- cTitel := cMessageLine1 + cMessageLine3 + cMessageLine5
-
-
-
- IF oError:SubstituteType =PTR
- oError:Severity := ES_CATASTROPHIC
- ENDIF
-
- cMessage :=ErrorMessage(oError)
-
- IF SetErrorLog()
- lOsError :=siFError <>0 .OR.siDOSError <>0 .OR.oError:OsCode <>0
- lErrorLog :=.T.
-
- IF !GetDefaultDir() ==""
- cFileErrorLog :=GetDefaultDir()
- ELSE
- cFileErrorLog :=GetDefault()
- ENDIF
-
- SplitPath(cFileErrorLog, pszDrive, NULL_PSZ, NULL_PSZ, NULL_PSZ)
- IF GetDriveType(Asc(UpperA(pszDrive) +DiskName()) -65) <>DRIVE_FIXED .AND.;
- GetDriveType(2) =DRIVE_FIXED
- cFileErrorLog :="C:"
- ENDIF
-
- IF ErrorCount() =1
- wI :=GetProfileInt(INI_GROUP_RUNTIME, "ErrorLogAppend", 2)
- IF wI >1
- wI :=0
- WriteProfileString(INI_GROUP_RUNTIME, "ErrorLogAppend", "0")
- ENDIF
- ELSE
- wI :=1
- ENDIF
-
-
- DO WHILE .T.
- cFileErrorLog +=FILE_ERRORLOG
- IF wI =1
- siFEL :=FOpen2(cFileErrorLog, FO_WRITE)
- ELSE
- siFEL :=F_ERROR
- ENDIF
-
- IF siFEL <>F_ERROR
- FSeek3(siFEL, 0, FS_END)
- Write3(siFEL, "", 0)
- ELSE
- siFEL :=FCreate2(cFileErrorLog, FC_NORMAL)
- IF FError() =3
- cFileErrorLog :=""
- IF !GetDefaultDir() ==""
- cBuffer :="SetDefaultDir: " +GetDefaultDir()
- SetDefaultDir("")
- ELSE
- cBuffer :="SetDefault: " +GetDefault()
- SetDefault("")
- ENDIF
-
- _IError(EG_ARG, .F., cBuffer)
- LOOP
- ENDIF
- ENDIF
- EXIT
- ENDDO
-
- IF siFEL <>F_ERROR
- cBuffer :=Replicate("*", 60) +Str(ErrorCount(), 12)
- _Hex(_GetInst(), PTR(_CAST, LONG(_CAST, cBuffer)+61))
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_ERROR)
- cMessageLine1 := VO_SPrintF(cFormat, cBuffer)
- Write2(siFEL, cMessageLine1)
-
- Write2(siFEL, Version())
- Write2(siFEL, TXT_VERSION)
- Write2(siFEL, DtoC(Today()) +TXT_SEP +Time();
- +TXT_SEP +TString(GetTickCount() /1000))
-
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_MODULE)
- cMessageLine1 := VO_SPrintF(cFormat, "")
-
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_LINE)
- cMessageLine3 := VO_SPrintF(cFormat, "")
-
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_ENTITY)
- cMessageLine5 := VO_SPrintF(cFormat, "")
-
- Write2(siFEL, Space(7);
- ;
- +PadR(cMessageLine1, 18) +" ";
- ;
- +PadL(cMessageLine3, 7) +" ";
- ;
- + cMessageLine5)
- FOR siI := _MaxAS() DOWNTO CUR_PROC
- Write2(siFEL, Str(siI, 5) +": ";
- +PadR(ProcFile(siI), 18) +" ";
- +Str( ProcLine(siI), 7) +" ";
- + ProcName(siI))
- IF InStr(":", ProcName(siI))
- strucMArgs :=MAKEPTR(_SS,_ProcBP(siI) +6)
- wCount :=MAX(strucMArgs.bPCount,;
- strucMArgs.bArgCount)
- IF wCount >0
- aArgs := ArrayInit(wCount, @strucMArgs.ptrData)
- FOR wJ := 1 UPTO wCount
- Write2(siFEL, Str(wJ,11) +": ";
- +PadR(TypeString(UsualType(aArgs[wJ])), 12);
- +LString(aArgs[wJ]))
- NEXT
- ENDIF
- oSelf :=OBJECT(_CAST, strucMArgs.ptrSelf)
- Write2(siFEL, " SELF: " +_AsString(oSelf))
- ENDIF
- NEXT
-
- Write2(siFEL, StrTran(cMessage, _CHR(ASC_LF), CrLf))
-
- IF oError:FuncPtr <>NULL_PTR
- ;
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_FUNCPTR)
- cMessageLine1 := VO_SPrintF(cFormat, AsString(oError:FuncPtr), Symbol2String(FunctionPtr2Sym(oError:FuncPtr)))
-
- Write2(siFEL, cMessageLine1)
- ENDIF
- IF ALen(oError:Args) >0
- Write2(siFEL, __CavoStr(__CAVOSTR_SYSLIB_ARGS))
- FOR wI :=1 UPTO ALen(oError:Args)
- cBuffer :=Str(wI, 3) +": "
- IF IsNIL(oError:Args[wI])
- cBuffer +="NIL"
- ELSE
- cBuffer +=;
- +PadR(TypeString(UsualType(oError:Args[wI])), 12);
- +LString(oError:Args[wI])
- ENDIF
- Write2(siFEL, cBuffer)
- NEXT
- ENDIF
-
- lDangerous :=InList(oError:GenCode,;
- EG_PROTECTION,;
- EG_STACK,;
- EG_CORRUPTION) .OR.;
- DynCheckError() <>0
-
- IF !lDangerous
- Write3(siFEL, "DynStack2Array():", 17)
- aDynStack :=DynStack2Array()
- siDynStack :=AScan(aDynStack, oError, -1, -0xFFFF) -1
- siDynStack :=AScan(aDynStack, oError, siDynStack, -0xFFFF) -1
- FOR siI :=1 TO siDynStack
- Write2(siFEL, LString(aDynStack[siI]))
- NEXT
- ENDIF
-
- IF !IsNIL(SysObject())
- Write2(siFEL, "SysObject() " +_AsString(SysObject()))
- ENDIF
-
- IF !Alias0() ==""
- Write2(siFEL, "Alias0(): " +Alias0())
- FOR wJ := 1 UPTO FCount()
- Write2(siFEL,;
- +PadR(FieldName(wJ), 23);
- +": ";
- +LString(FieldGetSym(FieldSym(wJ))))
- NEXT
- ENDIF
-
- IF !InList(oError:GenCode,;
- EG_DATATYPE,;
- EG_NOVAR,;
- EG_UNSUPPORTED,;
- EG_ZERODIV,;
- EG_SYNTAX)
- Write2(siFEL, "Memory():")
- aDynStack :={;
- "SYSTEM_FREE",;
- "SYSTEM_MAX",;
- "DYNINFOFREE",;
- "DYNINFOMAX",;
- "RT_DGROUP_SIZE",;
- "RT_DS_SIZE",;
- "STACK_SIZE",;
- "STACK_FREE",;
- "MAXATOM",;
- "ACTIVATION",;
- "PUBLIC",;
- "PRIVAT",;
- "DYNINFOUSED",;
- "MEMTOTAL",;
- "DS_SIZE",;
- "CS_SIZE",;
- "REGISTEREXIT_COUNT",;
- "REGCOLLNOTIFYSTART_COUNT",;
- "REGCOLLNOTIFYEND_COUNT",;
- "REGISTERKID",;
- "REGISTERAXIT",;
- "COLLECTCOUNT",;
- "DYNINFOSIZE",;
- "RT_DGROUP",;
- "RT_DS",;
- "SS",;
- "DS",;
- "CS",;
- "SEQUENCE",;
- "STACKKID",;
- "SP",;
- "GLOBALSEL",;
- "FUNCTIONCOUNT",;
- "CLASSCOUNT",;
- "DB_DS",;
- "DB_DS_SIZE"}
- FOR wI := 0 UPTO 35
- IF InList(wI,4,5,6,7,8,9,10,11,14,15,23,24,25,26,27,28,30,34,35)
- IF Memory(wI) >=0x10000
- cBuffer :=": 0x00000000"
- _Hex(Memory(wI) /0x10000, PTR(_CAST, LONG(_CAST, cBuffer)+7))
- ELSE
- cBuffer :=": 0x0000"
- ENDIF
- _Hex(Memory(wI) %0x10000, PTR(_CAST, LONG(_CAST, cBuffer)+11))
- ELSE
- cBuffer :=":" +Str(Memory(wI), 14)
- ENDIF
- Write2(siFEL, Str(wI, 3) +cBuffer +" " +aDynStack[wI+1])
- NEXT
-
- Write2(siFEL, "100:"+Str(Memory(100), 4) +"% SYSTEM resources")
- Write2(siFEL, "101:"+Str(Memory(101), 4) +"% GDI resources")
- Write2(siFEL, "102:"+Str(Memory(102), 4) +"% USER resources")
-
- Write3(siFEL, "GetNumTasks() ";
- +Str(GetNumTasks() , 3), 18)
- Write3(siFEL, "SetCPU() ";
- +Str(SetCPU() , 3), 18)
- Write3(siFEL, "SetMath() ";
- +Str(SetMath() , 3), 18)
- IF !_MathCheck()
- Write3(siFEL, "_MathCheck() F", 16)
- ENDIF
- IF InCollect()
- Write3(siFEL, "InCollect() T", 16)
- ENDIF
-
- IF !lDangerous
- Write3(siFEL, "_DynCheck() ";
- +LtoC(_DynCheck()) , 16)
- ENDIF
- IF DynCheckError() <>0
- Write2(siFEL, "DynCheckError()";
- +Str(DynCheckError(), 3);
- +Str(DynCheckErrorInfo(), 3);
- +" " +Symbol2String(DynCheckErrorSym()))
- ENDIF
- Write3(siFEL, "_GetRTCount() ";
- +Str(_GetRTCount() , 3), 18)
- Write3(siFEL, "_GetRTNum() ";
- +Str(_GetRTNum() , 3), 18)
- IF NetErr()
- Write3(siFEL, "NetErr() T", 16)
- ENDIF
- IF !Empty(NetName())
- Write2(siFEL, "NetName() " +NetName())
- ENDIF
- IF ErrorLevel() <>0
- Write3(siFEL, "ErrorLevel() ";
- +Str(ErrorLevel() , 3), 18)
- ENDIF
- Write2(siFEL, "GetDOSError() ";
- +Str(GetDOSError() , 3);
- +TXT_SEP +DOSErrString(GetDOSError()))
-
- p :=_MAKEPTR(_SS, 0x2A)
- wJ :=WORD(p)
- Write2(siFEL, "ErrorAct() " +Str(wJ, 3))
- p :=_MAKEPTR(_SS, 0x2C)
- wJ :=WORD(p)
- Write2(siFEL, "ErrorOrg() " +Str(wJ, 3))
- p :=_MAKEPTR(_SS, 0x76)
- wJ :=WORD(p)
- Write2(siFEL, "ErrorBase() " +Str(wJ, 3))
-
- IF siDOSError <>0
- Write2(siFEL, "DOSError() ";
- +Str(siDOSError , 3);
- +TXT_SEP +DOSErrString(siDOSError))
- ENDIF
- IF siFError <>0
- Write2(siFEL, "FError() ";
- +Str(siFError , 3);
- +TXT_SEP +DOSErrString(siFError))
- ENDIF
- Write2(siFEL, "OS() " +OS())
- IF !FPathName() ==""
- Write2(siFEL, "FPathName() " +FPathName())
- ENDIF
- IF !GetDefaultDir() ==""
- Write2(siFEL, "GetDefaultDir()" +GetDefaultDir())
- ENDIF
- IF !GetDefault() ==""
- Write2(siFEL, "GetDefault() " +GetDefault())
- ENDIF
- IF !GetPath() ==""
- Write2(siFEL, "GetPath() " +GetPath())
- ENDIF
- Write3(siFEL, "PATH=", 5)
- Write2(siFEL, GetEnv("PATH"))
-
- cBuffer :=Buffer(128)
- Write2(siFEL, "GetWindowsDirectory(): ";
- +Left(cBuffer,GetWindowsDirectory(cBuffer, 128)))
-
- Write2(siFEL, "GetSystemDirectory(): ";
- +Left(cBuffer,GetSystemDirectory(cBuffer, 128)))
-
- Write2(siFEL, "GetModuleFileName(): ";
- +Left(cBuffer,GetModuleFileName(_GetInst(), PTR(_CAST, cBuffer), 128)))
-
- IF !Empty(_GetCmdLine())
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_CMD_LINE)
- cMessageLine1 := VO_SPrintF(cFormat, _GetCmdLine())
-
- Write2(siFEL, cMessageLine1)
- ENDIF
-
- Write2(siFEL, "[" +INI_GROUP_RUNTIME +"]")
- wI :=GetProfileInt(INI_GROUP_RUNTIME, "DynamicMemory", 0)
- p :=_MAKEPTR(_SS, 0x86)
- wJ :=WORD(p)
- Write3(siFEL, "DynamicMemory= ";
- +Str(wI, 3);
- +Str(wJ, 5), 23)
- wI :=GetProfileInt(INI_GROUP_RUNTIME, "Trap", 0)
- p :=_MAKEPTR(_SS, 0x56)
- wJ :=WORD(p)
- Write3(siFEL, "Trap= ";
- +Str(wI, 3);
- +Str(wJ, 5), 23)
-
- IF lOsError
- cCurDiskName :=DiskName()
- ;
- Write2(siFEL, PadR(__CavoStr(__CAVOSTR_SYSLIB_DISK), 4) +" ";
- ;
- +PadL(__CavoStr(__CAVOSTR_SYSLIB_DISK_FREE), 8);
- ;
- +__CavoStr(__CAVOSTR_SYSLIB_CURDIR))
- FOR wI := 0 UPTO 26
- IF GetDriveType(wI) =DRIVE_FIXED
- cDiskName :=CHR(65 +wI)
- IF DiskChange(cDiskName)
- Write2(siFEL,;
- IIF(cDiskName ==cCurDiskName, "*", " ");
- +cDiskName +":";
- +Str(DiskFree(), 10);
- +" ";
- +CurDir())
- ENDIF
- ENDIF
- NEXT
- DiskChange(cCurDiskName)
-
- ;
- Write2(siFEL, PadR(__CavoStr(__CAVOSTR_SYSLIB_HANDLE), 3) +" ";
- ;
- +PadL(__CavoStr(__CAVOSTR_SYSLIB_HANDLE_END), 14) +" ";
- ;
- +PadL(__CavoStr(__CAVOSTR_SYSLIB_HANDLE_CUR), 14))
- FOR siI := 5 UPTO 255
- IF siI <>siFEL
- dwFilePos :=FTell(siI)
- IF FSeek3(siI, 0L, SEEK_END) >0
- Write3(siFEL, Str(siI, 3) +":";
- +Str(FTell(siI), 14);
- +Str(dwFilePos, 15), 33)
- FSeek3(siI, dwFilePos, SEEK_SET)
- ENDIF
- ENDIF
- NEXT
-
- ENDIF
- ENDIF
- FClose(siFEL)
- ENDIF
-
- ENDIF
-
- wChoice :=Min(oError:Choice, 3)
-
- IF wChoice =EC_ALERT .OR. awButton[wChoice] =0
-
-
-
- wChoice := ErrorMessageBox(STRTRAN(cMessage,"&","&&"), cTitel, awButton[1], awButton[2], awButton[3])
- ENDIF
-
- IF lErrorLog
- siFEL :=FOpen2(cFileErrorLog, FO_WRITE)
- IF siFEL <>F_ERROR
- FSeek3(siFEL, 0, FS_END)
- cFormat := __CavoStr(__CAVOSTR_SYSLIB_CHOICE)
- cMessageLine1 := VO_SPrintF(cFormat, Str(oError:Choice, 3) +Str(wChoice, 3) +TXT_SEP , Time())
-
- Write2(siFEL, cMessageLine1)
- FClose(siFEL)
- ENDIF
- ENDIF
-
- IF oError:GenCode <>EG_MEM
- DynUnLock()
- ENDIF
-
- wDefError -=1
- FError( siFError)
- DOSError(siDOSError)
-
- DO CASE
- CASE wChoice =1
- IF oError:CanSubstitute
- RETURN EmptyUsual(oError:SubstituteType)
- ELSE
- RETURN E_DEFAULT
- ENDIF
- CASE wChoice =2
- RETURN E_RETRY
- ENDCASE
-
- _MathInit()
- IF CanBreak()
- BREAK oError
- ENDIF
-
- ErrorLevel(oError:GenCode)
- _Quit()
-
- STATIC FUNCTION ErrorMessage(oError AS OBJECT) AS STRING PASCAL
- LOCAL cMessage AS STRING
- LOCAL sArg AS STRING
- LOCAL wArgType AS WORD
- LOCAL cSymbol AS STRING
- LOCAL cMessage1 AS STRING
-
- DO CASE
- CASE oError:Severity = ES_WARNING
- cMessage := __CavoStr(__CAVOSTR_SYSLIB_WARNING)
- CASE oError:Severity = ES_CATASTROPHIC
- cMessage := __CavoStr(__CAVOSTR_SYSLIB_DANGER)
- ENDCASE
-
-
- IF oError:GenCode <>0
- cMessage += " "+ErrString(oError:GenCode)
- ENDIF
-
- IF !oError:SubSystem ==""
- cMessage += TXT_SEP+vo_SPrintF(__CAVOSTR_SYSLIB_SUBSYSTEM,oError:SubSystem)
- ENDIF
-
- if !empty(cMessage)
- cMessage += TXT_SEP
- endif
-
- IF oError:SubCode <>0
- cMessage1 := NTrim(oError:SubCode)
- IF !oError:SubCodeText ==""
- cMessage1 += "("+oError:SubCodeText+")"
- ENDIF
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_SUBCODE, cMessage1) + TXT_SEP
- ENDIF
-
- if !empty(cMessage)
- cMessage += _chr(ASC_LF)
- endif
-
- DO CASE
- CASE oError:FuncSym <>NULL_SYMBOL
- cSymbol :=Symbol2String(oError:FuncSym)
- IF InStr("=>", cSymbol)
- DO CASE
- CASE cSymbol =="=>"
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_CONVERSION," ")
- CASE cSymbol = "=>"
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_CONVERSION_TO,"USUAL",SubStr2(cSymbol, 3))
- OTHERWISE
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_CONVERSION,cSymbol)
- ENDCASE
- ELSE
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_FUNCTION,cSymbol)
- ENDIF
- cMessage += TXT_SEP
- IF oError:CallFuncSym <>NULL_SYMBOL .AND.oError:CallFuncSym <>oError:FuncSym
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_CALLED_FROM,Symbol2String(oError:CallFuncSym))+TXT_SEP
- ENDIF
- CASE oError:CallFuncSym <>NULL_SYMBOL
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_FUNCTION,Symbol2String(oError:CallFuncSym))+TXT_SEP
- ENDCASE
-
- cMessage += _chr(ASC_LF)
-
- IF !oError:Description ==""
- cMessage += oError:Description +TXT_SEP
- ENDIF
-
- IF !oError:FileName ==""
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_FILE,oError:FileName) + TXT_SEP
- ENDIF
-
- IF !oError:Operation ==""
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_OPERATION,oError:Operation) + TXT_SEP
- ENDIF
-
- IF oError:CanRetry
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_TRIES,NTrim(oError:Tries)) + TXT_SEP
- ENDIF
-
- cMessage += _chr(ASC_LF)
-
- IF oError:OsCode <>0
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_DOS_ERROR,NTrim(oError:OsCode)+" ("+DOSErrString(oError:OsCode) +")") + TXT_SEP
- ENDIF
-
- IF oError:FileHandle <>0
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_FILE_HANDLE,NTrim(oError:FileHandle)) + TXT_SEP
- ENDIF
-
- cMessage += _chr(ASC_LF)
-
- wArgType :=oError:ArgType
- sArg :=Left(oError:Arg, 40)
- IF oError:ArgNum <>0
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_ARGNUM,NTrim(oError:ArgNum)) + TXT_SEP
- IF oError:ArgNum < =ALen(oError:Args)
- wArgType:=UsualType(oError:Args[oError:ArgNum])
- sArg :=LString(oError:Args[oError:ArgNum])
- ENDIF
- ENDIF
-
- IF !sArg ==""
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_ARG,sArg) + TXT_SEP
- ENDIF
-
- IF wArgType <>0
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_ARGTYPE,TypeString(wArgType)) + TXT_SEP
- ENDIF
-
- IF oError:ArgTypeReq <>0 .AND. oError:ArgTypeReq <>oError:ArgType
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_ARGTYPE_REQ,TypeString(oError:ArgTypeReq)) + TXT_SEP
- ENDIF
-
- IF oError:MaxSize <>0 .OR. oError:GenCode = EG_BOUND
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_MAX,NTrim(oError:MaxSize)) + TXT_SEP
- ENDIF
-
- cMessage += _chr(ASC_LF)
-
- IF oError:MethodSelf <>NULL_OBJECT
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_OBJECT,_AsString(oError:MethodSelf)) + TXT_SEP
- ENDIF
-
- IF oError:CanSubstitute
- cMessage += VO_SPrintF(__CAVOSTR_SYSLIB_SUBST_TYPE,TypeString(oError:SubstituteType)) + TXT_SEP
- ENDIF
-
- RETURN cMessage
-
- PROC ERRORSYS AS VOID PASCAL _INIT1
- ErrorBlock( {|oError| DefError(oError)} )
- STATIC FUNCTION LString(x AS USUAL) AS STRING PASCAL
- LOCAL cRet AS STRING
- LOCAL bSaveHandler AS CODEBLOCK
- LOCAL oError AS USUAL
-
- bSaveHandler :=ErrorBlock( {|o|_Break(o)})
-
- BEGIN SEQUENCE
- cRet :=Left(_AsString(x), 40)
- IF UsualType(x) =WORD(_CAST, ARRAY)
- cRet +=" " +ADimPic(x)
- cRet +=" APageCount() " +NTrim(APageCount(x))
- ENDIF
-
- RECOVER USING oError
-
- cRet :=__CavoStr(__CAVOSTR_SYSLIB_ARG_ERROR)
- END SEQUENCE
-
- ErrorBlock(bSaveHandler)
-
- RETURN cRet
- _DLL FUNC voerror10_sprintf( ;
- outputString AS PSZ, ;
- format AS STRING, ;
- v1 as STRING, ;
- v2 as STRING, ;
- v3 as STRING, ;
- v4 as STRING, ;
- v5 as STRING, ;
- v6 as STRING, ;
- v7 as STRING, ;
- v8 as STRING, ;
- v9 as STRING, ;
- v10 as STRING) ;
- AS SHORTINT PASCAL: CAVORT10.924
-
- _DLL INTERNAL _VOSPRINTF:CAVORT10.925
- _DLL INTERNAL _VOVSPRINTF:CAVORT10.926
-
- FUNCTION VO_SPrintF(Format,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10)
- local ptrBuff as PSZ
- local sOutput as String
- if IsNumeric(Format)
- format := __CavoStr(format)
- endif
- Default(@V1, Null_String)
- Default(@V2, Null_String)
- Default(@V3, Null_String)
- Default(@V4, Null_String)
- Default(@V5, Null_String)
- Default(@V6, Null_String)
- Default(@V7, Null_String)
- Default(@V8, Null_String)
- Default(@V9, Null_String)
- Default(@V10,Null_String)
- if !Empty(format)
- ptrBuff:=MemAlloc(256)
- VOError10_SPrintF(ptrBuff,format,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10)
- sOutput := Psz2String(psz(_cast,ptrBuff))
- MemFree(ptrBuff)
- endif
- return sOutput
-
- STATIC FUNCTION Write2(siFile AS SHORTINT, c AS _NC STRING) AS WORD PASCAL
- LOCAL wRet AS WORD
- wRet :=FPutS(siFile, c)
- FCommit(siFile)
- RETURN wRet
- STATIC FUNCTION Write3(siFile AS SHORTINT, c AS _NC STRING, wCount AS WORD) AS WORD PASCAL
- LOCAL wRet AS WORD
- wRet :=FPutS3(siFile, c, wCount)
- FCommit(siFile)
- RETURN wRet
-