ALERT Function in Basic 7.10 UI Toolbox Destroys TEXT$ (66690)






This article was previously published under Q66690

SYMPTOMS

The ALERT function in the User Interface (UI) Toolbox destroys the string sent to it in the TEXT$ field of the function call.

WORKAROUND

Any one of the following workarounds will correct the problem but choices 1 and 2 may be easiest because they don't require recompiling WINDOW.BAS or building new UI Toolbox support libraries:

  1. Enclose the TEXT$ parameter in parentheses. For example, the following statement
          Alert(4, a$, 6, 20, 15, 60, "OK", "CANCEL", "")
    						
    should be changed to the following:
          Alert(4, (a$), 6, 20, 15, 60, "OK", "CANCEL", "")
    						
  2. Make a copy of the string before calling the ALERT function, as follows:
          temp$ = a$
          ALERT(4, a$, 6, 20, 15, 60, "OK", "CANCEL", "")
          a$ = temp$
    						
  3. Modify the ALERT function in WINDOW.BAS as follows:

    1. Right after the line that says
                  FUNCTION Alert (style, text$...
      								
      put the following statement:
                  TempText$ = test$
      								
    2. Right before the END FUNCTION at the bottom of the function, put the following statement:
                   test$ = TempText$
      								
      You should then make a new Quick library (.QLB) and a new LINK library (.LIB) that use the new version of ALERT, as shown in the following:

      BC /X/FS GENERAL.BAS;
      BC /X/FS WINDOW.BAS;
      BC /X/FS MOUSE.BAS;
      BC /X/FS MENU.BAS
      LIB UITB+GENERAL+WINDOW+MOUSE+MENU+UIASM+QBX.LIB;
      LINK /Q UITB.LIB, UITB.QLB, , QBXQLB.LIB;

      Invoke QBX.EXE using the new UITB.QLB Quick library, as follows:

      QBX /L UITB

STATUS

Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB66690