' vi: ft=vb
option explicit
implements dbgWriter
private worksheetOut as worksheet
private curRow as long
public sub class_initialize() ' {
curRow = 0
end sub ' }
public sub class_terminate() ' {
end sub ' }
public sub init(wb as workbook, worksheetName as string) ' {
set worksheetOut = wb.worksheets.add
worksheetOut.visible = xlSheetVeryHidden
worksheetOut.name = worksheetName
end sub ' }
public sub dbgWriter_out(txt as string) ' {
curRow = curRow + 1
worksheetOut.cells(curRow, 1).value = txt
worksheetOut.cells(curRow, 1).font.name = "Courier New"
end sub ' }
Note that the current implementation (2020-08-16) writes into a very hidden worksheet.
Test case for dbgExcelWriter
option explicit
dim dbg_ as dbg
sub main() ' {
set dbg_ = new dbg
dim excelWriter as new dbgExcelWriter
excelWriter.init activeWorkbook, "dbg"
dbg_.init excelWriter
dbg_.text "started"
F1
F2
end sub ' }
sub F1() ' {
dbg_.indent "F1"
dbg_.text "in F1"
F2
dbg_.dedent
end sub ' }
sub F2() ' {
dbg_.indent "F2"
dbg_.text "in F2"
dbg_.dedent
end sub ' }