summaryrefslogtreecommitdiff
path: root/wizards/source/access2base/Compatible.xba
blob: bf418d3b9acbcae0f5cfcd88be96581cd4348b81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Compatible" script:language="StarBasic"
REM =======================================================================================================================
REM ===					The Access2Base library is a part of the LibreOffice project.									===
REM ===					Full documentation is available on http://www.access2base.com									===
REM =======================================================================================================================

Option Compatible
Option Explicit

REM -----------------------------------------------------------------------------------------------------------------------
Public Sub DebugPrint(ParamArray pvArgs() As Variant)

&apos;Print arguments unconditionally in console
&apos;Arguments are separated by a TAB (simulated by spaces)
&apos;Some pvArgs might be missing: a TAB is still generated

Dim vVarTypes() As Variant, i As Integer
Const cstTab = 5
	On Local Error Goto Exit_Sub	&apos;	Never interrupt processing
	Utils._SetCalledSub(&quot;DebugPrint&quot;)
	vVarTypes = Utils._AddNumeric(Array(vbEmpty, vbNull, vbDate, vbString, vbBoolean, vbObject, vbVariant, vbByte, vbArray + vbByte))
	
	If UBound(pvArgs) &gt;= 0 Then
		For i = 0 To UBound(pvArgs)
			If Not Utils._CheckArgument(pvArgs(i), i + 1, vVarTypes(), , False) Then pvArgs(i) = &quot;[TYPE?]&quot;
		Next i
	End If

Dim sOutput As String, sArg As String
	sOutput = &quot;&quot;	
	For i = 0 To UBound(pvArgs)
		sArg = Replace(Utils._CStr(pvArgs(i), _A2B_.DebugPrintShort), &quot;\;&quot;, &quot;;&quot;)
		&apos; Add argument to output
		If i = 0 Then
			sOutput = sArg
		Else
			sOutput = sOutput &amp; Space(cstTab - (Len(sOutput) Mod cstTab)) &amp; sArg
		End If
	Next i
	
	TraceLog(TRACEANY, sOutput, False)
	
Exit_Sub:
	Utils._ResetCalledSub(&quot;DebugPrint&quot;)
	Exit Sub
End Sub			&apos;	DebugPrint		V0.9.5

</script:module>