1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"Compatible" script:
language=
"StarBasic">REM =======================================================================================================================
4 REM === The Access2Base library is a part of the LibreOffice project. ===
5 REM === Full documentation is available on http://www.access2base.com ===
6 REM =======================================================================================================================
11 REM -----------------------------------------------------------------------------------------------------------------------
12 Public Sub DebugPrint(ParamArray pvArgs() As Variant)
14 'Print arguments unconditionnally in console
15 'Arguments are separated by a TAB (simulated by spaces)
16 'Some pvArgs might be missing: a TAB is still generated
18 Dim vVarTypes() As Variant, i As Integer
20 On Local Error Goto Exit_Sub
' Never interrupt processing
21 Utils._SetCalledSub(
"DebugPrint
")
22 vVarTypes = Utils._AddNumeric(Array(vbEmpty, vbNull, vbDate, vbString, vbBoolean, vbObject, vbVariant))
24 If UBound(pvArgs)
>=
0 Then
25 For i =
0 To UBound(pvArgs)
26 ' If IsError(pvArgs(i)) Then
' IsError gives
"Object variable not set
" in LO
4,
0 ?!?
27 ' pvArgs(i) =
"[ERROR]
"
29 If Not Utils._CheckArgument(pvArgs(i), i +
1, vVarTypes(), , False) Then pvArgs(i) =
"[TYPE?]
"
34 Dim sOutput As String, sArg As String
35 sOutput =
""
36 For i =
0 To UBound(pvArgs)
37 sArg = Utils._CStr(pvArgs(i))
38 ' Add argument to output
42 sOutput = sOutput
& Space(cstTab - (Len(sOutput) Mod cstTab))
& sArg
46 TraceLog(TRACEANY, sOutput, False)
49 Utils._ResetCalledSub(
"DebugPrint
")
51 End Sub
' DebugPrint V0.9
.5