Sheet Extender is a class that allows to add a small button to each TAB control. This button has no default action, the demo demonstrates
only 3 possible actions: dropdown menu, close button, help button.
TSheetExtMixed CLASS(TSheetExtBase), TYPE
OnDrawCustomButton PROCEDURE(TDC pDc, SIGNED pTabFeq, TRect pTabRect), PROTECTED, DERIVED
OnCustomButtonPressed PROCEDURE(SIGNED pTabFeq), BOOL, PROTECTED, DERIVED
END
In this handler choose which button will be drawn on which tab:
TSheetExtMixed.OnDrawCustomButton PROCEDURE(TDC pDc, SIGNED pTabFeq, TRect pTabRect)
CODE
CASE pTabFeq
OF ?TAB3_1
SELF.SetCustomButtonAsHelp()
OF ?TAB3_2
SELF.SetCustomButtonAsClose()
OF ?TAB3_3
SELF.SetCustomButtonAsDropDown()
END
PARENT.OnDrawCustomButton(pDc, pTabFeq, pTabRect)
You can remove the Include PrintF.inc the 2 calls to PrintD() are commented. If you need that code it is simple enough to replace with a call to OutputDebugString and concatenation.
I agree the PrintF syntax can be elegant for many purposes. Obviously C programmers like it, but IIRC they can’t easily concat bunches of variables easily like in Clarion. The formatting of some values like Date, Time, Hex are “goodies” that save code and produce better results.
Most of my debug is Label=Value multiple times DB('UpdateAPTransProcess - AddToCksFile Vndr: '& PeTran:VendorAutoNo &' Src: '&PeTran:JrnlSrc &' CKNO: '& PeTran:CkNo &' ACCT: '& CLIP(ACTMST:AcctNo) &' AMT: '& PeTran:Debit &' REF: '&PeTran:RefNo)
So your way the 6 Labels and Variables would separate: PrintD('UpdateAPTransProcess - AddToCksFile Vndr: %i Src: %z CKNO: %i ACCT: %s AMT: %f REF: %z', PeTran:VendorAutoNo, PeTran:JrnlSrc, PeTran:CkNo, ACTMST:AcctNo, PeTran:Debit, PeTran:RefNo)
For me coding Debug often variables are inserted, removed, rearranged, copied. That’s easier cut/paste/delete with the Literal=Variable next to each other.
There is A LOT of Debug left in the old code I work on, much in batch processes so 100s or 1000s. I would be concerned the code that runs inside PrintD() slowing it. There are many ANYs and the concat 1 byte at a time using ANY is slow hence string libraries. In reality it probably does not matter as CPUs are so fast.
PrintF() does look nice to create a Message() so you can focus on the complete message text and not have the text cluttered with concatenated variables. There are usually not as many variables and much more text. There aren’t 100s of Messages showing during a process like Debug. I am trying PrintF and will send you some thoughts.