Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking for existence of a control
Message
De
18/09/2002 17:18:11
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00701952
Message ID:
00702035
Vues:
19
>It escapes me the syntax for checking for the existence of a control like a commandbutton. If...............?
>
>-TB


you already have other replies, but another way is
FUNCTION Form_Has_This_Control
  PARAMETER PARAM_Form_Ref , PARAM_Control_Name

  LOCAL int_Control_Count
  LOCAL int_Control_Index
  LOCAL str_Control_Name
  LOCAL boo_Value_To_Return

  boo_Value_To_Return = .F.
  int_Control_Count = PARAM_Form_Ref.CONTROLCOUNT

  FOR int_Control_Index = 1 TO int_Control_Count
    str_Control_Name = PARAM_Form_Ref.CONTROLS(int_Control_Count).NAME
    IF ( str_Control_Name = PARAM_Control_Name )
      boo_Value_To_Return = .T.
    ENDIF
  ENDFOR

  RETURN ( boo_Value_To_Return )
ENDFUNC
may want to do ALLTRIM(UPPER(X)) on both items in IF stmt.
patrick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform