# MBST\_SAVRES > [HTML Version](mbst_savres.htm) _Added January 2013; see History_ The _cstate_ flag MBST\_SAVRES can be applied to the CTLOP\_CLR and CTLOP\_PANE operations operations when operating on TabX controls to have the client module save the contents of the panel being cleared, and restore the previously saved contents of the new panel (if available). When switching from one TabX panel to another, the traditional protocol is to first call CTLOP\_CLR to clear the controls from the current panel, then call CTLOP\_PANE to establish the new panel, and finally (re)create the controls on the panel. The new feature doesn't change that logic, except as follows: To request that the existing contents of the panel be saved before the panel is cleared, specify the _cstate_ parameter with the MBST\_SAVRES flag in the CTLOP\_CLR call: xcall AUI, AUI\_CONTROL, CTLOP\_CLR, tabid\$, NUL\_CTEXT\$, MBST\_SAVRES To request that the previously saved controls for the new panel be restored, specify the _cstate_ parameter with the MBST\_SAVRES flag in the CTLOP\_PANE call. To confirm whether any controls were actually saved, you should also specify up to the _cstatus_ parameter (which will return the count of the number of controls restored): xcall AUI, AUI\_CONTROL, CTLOP\_PANE, tabid\$, paneid\$, MBST\_SAVRES, NUL\_CTYPE, NUL\_CMD\$, NUL\_FUNC\$, status if status <= 0 then \! if no controls restored <(re)create the controls for the new panel> endif **Notes** • You need to identify the panel to switch to by putting the panel's label text or cmd string into the _paneid\$_ parameter (i.e. ctext), rather than putting the panel number into the _cstate_ parameter (as in the traditional Tab control). This leaves the _cstate_ parameter available for the MBST\_SAVRES flag. • By checking the returned _status_ parameter, you can determine whether the restore operation was successful without actually having to keep track of whether that panel has previously been displayed and saved (or even whether the ATE client version is sufficient to support the feature). • You must perform the CTLOP\_CLR first, then the CTLOP\_PANE. The reverse order is possible, but not when using MBST\_SAVRES. • The motivation behind the MBST\_SAVRES feature is not to simplify your application coding; in fact, it makes it slightly more complex. Instead, the motivation is to improve the performance of switching between panels, particularly with ATE and with complex controls like XTREE and XTEXT. **History** 2013 January, A-Shell 6.1.1332: Flag added to A-Shell