PRB: Updating Memvars When Checking Spelling of Edit Fields

Last reviewed: April 30, 1996
Article ID: Q109610
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, version 3.0
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for Macintosh, versions 2.5b

SYMPTOMS

If a memo field is opened within a program using the MODIFY MEMO command with the NOWAIT clause, the spelling checker can be used to update the spelling of words within the memo field. But before the updated contents of that memo field can be used to update a memory variable, the window opened with the MODIFY MEMO command must be released. This situation normally occurs when the SCATTER MEMVAR MEMO command is used with GET fields in a screen.

MORE INFORMATION

In addition to memo fields, the spelling checker can be used to check the spelling of other text files.

Steps to Reproduce Problem

The following sample program can be used to illustrate the problem. It uses the SALESMAN database that is found in the TUTORIAL subdirectory.

   CLEAR
   CLEAR ALL
   USE salesman
   SCATTER MEMVAR MEMO BLANK
   button=0
   STORE "Delete this and type something that is misspelled" TO ;
        m.notes

   @ 0.077,0.000 SAY "Salesman" ;
        FONT "MS Sans Serif",8 ;
        STYLE "BT"
   @ 0.077,12.400 GET m.salesman ;
        SIZE 1.000,4.400 ;
        DEFAULT "" ;
        FONT "MS Sans Serif",8 ;
        PICTURE "@K"
   @ 2.231,0.000 SAY "Notes" ;
        FONT "MS Sans Serif",8 ;
        STYLE "BT"
   @ 2.231,12.400 EDIT m.notes ;
        SIZE 3.000,25.000,0.000 ;
        PICTURE "@K" ;
        DEFAULT "" ;
        FONT "MS Sans Serif",8 ;
        SCROLL STYLE "BT"
   @ 2.769,69.600 GET button ;
        PICTURE "@*VN Quit;Spell" ;
        SIZE 1.769,6.833,0.308 ;
        DEFAULT 1 ;
        FONT "MS Sans Serif",8 ;
        STYLE "BT" VALID butval()
   READ CYCLE

   SELECT salesman
   USE
   CLEAR ALL
   CLEAR

   FUNCTION butval
   DO CASE
       CASE button=1
             CLEAR READ
       CASE button=2
             CREATE TABLE vnote (result m)
             INSERT INTO vnote (result) VALUES (m.notes)
             MODIFY MEMO vnote.result NOWAIT
             DO (_spellchk)
             STORE vnote.result TO m.notes
             SHOW GETS
             WAIT WINDOW "The memo field is not updated"
             RELEASE WINDOW vnote.result
             STORE vnote.result TO m.notes
             SHOW GETS
             WAIT WINDOW "Now the memo field variable is updated"
   ENDCASE

The spelling corrections in the above program will be seen in the window named VNOTE.RESULT but not in the edit field into which the misspelled words were originally typed until the VNOTE.RESULT window is released. This behavior is necessary so that the memory variable can be updated. Since the memo is being edited NOWAIT, the editing window must be released before the VNOTE.RESULT field in the temporary table, VNOTE, is updated. The memo field needs to be edited NOWAIT so that program execution can proceed and check the spelling of the memo.

REFERENCES

FoxPro for Windows Help file

FoxPro for Windows "Language Reference," version 2.5, pages L3-31 to L3-40, L3-349 to L3-350, L3-586 to L3-587, L3-662 to L3-664, L3-851 to L3-853, L3-1023


Additional reference words: VFoxWin 3.00 FoxMac FoxWin 2.50 2.50a 2.50b
KBCategory: kbenv kbprg kbprb kbcode
KBSubcategory: FxenvMemory


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.