Robert wrote:Robert wrote:- In OpenTabDlg are both IFs necessary, or could the second one be an ELSE?.
Josef Templ wrote:In OpenTabDlg both IFs are necessary, I think.
- Code: Select all
PROCEDURE OpenTabDlg(r: Ruler; tabIndex: INTEGER);
VAR tc: Kernel.Module;
BEGIN
IF tabDialogHook = NIL THEN tc := Kernel.ThisMod("TextCmds") END;
IF tabDialogHook # NIL THEN tabDialogHook.Open(r, tabIndex) END
END OpenTabDlg
So calling
Kernel.ThisMod can have the side effect of changing
tabDialogHook from NIL to non-NIL?, or am I missing something?
I thought I had already responded to this but the posting does not show up. Anyway here is it again:
Under a normal BB startup sequence TextCmds would be loaded anyway and tabDialogHook is already set.
Under a non-standard startup sequence (application specific, for whatever reason different, e.g. different menu bar)
TextCmds may not have been loaded yet and therefore there is an attempt to load it.
This sets tabDialogHook if the attempt is successful.
Opening the tab dialog must be done in any case if tabDialogHook is set. This is a separate step
following the optional loading step.
- Josef