How to Determine If Text Is Highlighted

Last reviewed: June 27, 1995
Article ID: Q105013
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5 and 2.5a
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

To determine if any text has been highlighted, you can use the SKPBAR() function to test the skip of the Copy bar of the Edit menu popup on the system menu. The SKPBAR() function returns .T. if the specified bar of a popup is disabled or .F. if the specified bar is enabled. For example:

  1. Type the following in the Command window:

          ON KEY LABEL f2 WAIT WINDOW ;
    
             IIF(SKPBAR('_msm_edit',_med_copy),"No Text is Selected", ;
             "Ready to Copy") NOWAIT
    
    

  2. Press F2. The result should be a wait window with the message "No Text is Selected."

  3. Highlight some text in the Command window. Press F2. The result should be a wait window with the message "Ready to Copy."

NOTE: If a custom menu is being used, the Copy bar (BAR# _med_copy) of the system menu must be available in order for this procedure to work correctly.


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a pop-up
KBCategory: kbprg
KBSubcategory: FxprgGeneral


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: June 27, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.