Microsoft KB Archive/129958

{| = BUG: Hiding a Screen Clears the Current READ Level =
 * width="100%"|

ID: Q129958

The information in this article applies to:


 * Microsoft FoxPro for Windows, version 2.6a

SYMPTOMS
When a "HIDE WINDOW screen_name" command is issued and the screen was created in the Screen Builder or by the Screen Wizard, the current READ LEVEL is cleared.

According to the READ topic in the Reference Manual, a user can exit a READ by moving beyond the last object or backward past the first object, by pressing ESC, by pressing CTRL+W, or by choosing a control that was defined to terminate the READ.

WORKAROUND
If you want to hide the current screen without clearing the READ LEVEL, move the screen to coordinates that exist outside the desktop. For example:

MOVE WINDOW screen_name to -100, -100

Additional Workaround Information
This additional information is not specific to Screen Builder or Screen Wizard screens but provides a method to prevent clearing the current READ level when hiding a user-defined window (as opposed to a Screen Builder or Wizard generated screen) that contains a GET field.

If a GET exists in a user-defined window, the following code demonstrates how to use a Read Deactivate event handler to check the existence of the window to hide it without clearing the current READ level:

ON KEY LABEL F2 SHOW WINDOW wndread ON KEY LABEL F3 HIDE WINDOW wndread

DEFINE WINDOW wndread FROM 1,1 TO 10,10 FLOAT ACTIVATE WINDOW wndread @1,1 GET ok DEFAULT 0 PICTURE "@*T OK" READ CYCLE DEACTIVATE r_deact

RELEASE WINDOW wndread ON KEY LABEL F2  ON KEY LABEL F3

PROCEDURE r_deact IF WEXIST("wndread") RETURN .F.  ENDIF

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Steps to Reproduce Problem
NOTE: The HIDE WINDOW command will clear the current READ regardless of the current READ level.

With the DEBUG open and RDLEVEL as the variable to display:

1. Create a screen (Screen1) that contains two buttons by using the Screen

Builder. 2. In the Valid of Button 1, add this command: HIDE WINDOW SCREEN1 3. In the Valid of Button 2, add this command: DO screen2.spr 2. Create a second screen (Screen2) that contains a single button by using the Screen Builder. In the Valid of the button, add this command:

HIDE WINDOW Screen2 3. Issue the following command: DO screen1.spr 4. Activate the second push button. When Screen2 activates, push the "HIDE SCREEN 2" push button. The second screen will deactivate and the READ LEVEL will go to 1. 5. On Screen 1, activate the first push button ("HIDE SCREEN 1"). The first screen will deactivate and the READ LEVEL will go to 0. Additional reference words: FoxWin 2.60a buglist2.60a KBCategory: kbprg kbbuglist kbcode KBSubcategory: FxprgGeneral
 * }