Something is wrong either with code or PB and have no idea why when window height and width is not bigger enough, the code where i check TypeOf() objects in control array of a window, TypeOf function fails.
And if i increase width and height then TypeOf function start working again.
Please see code and attached debugger image to figure out reason
_errorLog("::: " + ClassName() + ": w_parent_sheet : Constructor: " + String(Now(), "HH:MM:SSSS") + ":" + "AUT:TRIG:YES-EX")
OrgTitle = Trim(st_tool_title.Text)
st_tool_title.Visible = FALSE
st_tool_title.Text = ""
Title = ""
Event Post _Constructor()
Integer win_object
StaticText st
w_parent_sheet TheParentWin
Parent.Win = Parent
TheParentWin = Parent.Win
Tab TheTab, TheChildTab
Uo_DataWindow DW
Integer control_counter
Integer Tabpage, TabPageChild, TabPageOfChildTab
FOR control_counter = 1 TO upperbound(TheParentWin.control)
/// folowwing line has unknown error because .TypeOf() returns nothing
/// This happens even at very first object in control array
CHOOSE CASE TheParentWin.control[control_counter].Typeof()
CASE DataWindow!
///_errorLog("DataWindow!" + TheParentWin.control[control_counter].Classname())
TRY
dw = TheParentWin.control[control_counter]
AllDW[UpperBound(AllDW) + 1] = DW
dw.Win = TheParentWin.Win
/// InView boolean value is set
IF DW.X < TheParentWin.Width AND DW.Y < TheParentWin.Height THEN
DW.InView = TRUE
ELSE
/// outsider
DW.InView = FALSE
END IF
CATCH(RuntimeError rte88101)
END TRY
/*This portion changes the label of the tabpages */
CASE Tab!
TheTab = TheParentWin.control[control_counter]
FOR Tabpage = 1 TO UpperBound(TheTab.control[])
/// going inside a tabpage
FOR TabPageChild = 1 TO UpperBound(TheTab.control[Tabpage].control)
CHOOSE CASE TheTab.control[Tabpage].control[TabPageChild].Typeof()
CASE DataWindow!
///_errorLog("DataWindow! inside tab " + TheTab.control[Tabpage].control[TabPageChild].Classname() )
TRY
dw = TheTab.control[Tabpage].control[TabPageChild]
AllDW[UpperBound(AllDW) + 1] = DW
dw.Win = TheParentWin.Win
/// InView boolean value is set for DWs inside a tab control
/// if tab control itself is inside view area then DW is consider InView
IF TheTab.X < TheParentWin.Width AND TheTab.Y < TheParentWin.Height THEN
DW.InView = TRUE
ELSE
/// outsider
DW.InView = FALSE
END IF
CATCH(RuntimeError rte8811)
END TRY
END CHOOSE
NEXT
NEXT
END CHOOSE
NEXT
Regards,
Berka
That was very helpful. TypeOf() did not fail but debugger was not showing enumerated datatypes.
New script worked nicely on PB2019 and on PB12.5.
Thank you.
True Regards,
Berka