Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MemberData Help
Message
De
18/03/2005 16:00:04
 
 
À
18/03/2005 13:15:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
00997267
Message ID:
00997443
Vues:
10
This is how I got it to work with any property name I use. THis is my Script in the MemberDataObject. The reason I populate the xoprops is I use it in the "ClassScript" to figure out what propertie(s) I am going to be updating.
PRIVATE xoProps
xoProps = NEWOBJECT('EMPTY')
ADDPROPERTY(xoProps,'MyClassLibrary','')
DO (_CODESENSE) WITH 'RunPropertyEditor','','GetClass'
This is the "GetClass" entry in Foxcode.dbf
TYPE   = "E"
ABBREV = "GetClass"
CMD    = "{ClassScript}
This is the "ClassScript" entry in Foxcode.dbf
LPARAMETER tcProp
IF VARTYPE(xoProps) = "O"
   lcLibrary  = ""
   lcClass    = ""
   llGetClass = .T.
   * SEE IF THERE ARE ANY MEMBERS IN THE xoProps object
   IF AMEMBERS(laMembers, xoProps) > 0
      * get the current values of both the Class and ClassLib
      FOR EACH lcMember IN laMembers
         IF "library" $ LOWER(lcMember)
            lcLibrary = LOWER(lcMember)
         ELSE
            lcClass   = LOWER(lcMember)
         ENDIF
      ENDFOR
        
      * Make sure that library and class values are filled in
      DO CASE 
      CASE EMPTY(lcLibrary) AND NOT EMPTY(lcClass)
         lcLibrary = lcClass + "library"
      CASE NOT EMPTY(lcLibrary) AND EMPTY(lcClass)
         lcClass = STRTRAN(lcLibrary, "library")
      ENDCASE 
      
      * get value for library and class
      lnSelObj = ASELOBJ(laObjs)
      IF lnSelObj = 0
         lnSelObj = ASELOBJ(laObjs,1)
      ENDIF 
         
      IF lnSelObj > 0
         FOR EACH loCtrl IN laObjs
            IF PEMSTATUS(loCtrl,lcLibrary,5) AND PEMSTATUS(loCtrl, lcClass, 5)
               EXIT
            ENDIF 
         ENDFOR 
         * get the current value in the properties
         lcLibraryValue = loCtrl.&lcLibrary.
         lcClassValue   = loCtrl.&lcClass.
         
         TRY
            llGetClass = AGETCLASS(laClass, lcLibraryValue, lcClassValue)
         CATCH
            llGetClass = AGETCLASS(laClass)
         ENDTRY
         IF llGetClass          
            * set the values to the properties.
            loCtrl.&lcLibrary. = JUSTFNAME(laClass[1])
            loCtrl.&lcClass.   = JUSTSTEM(laClass[2])
         ENDIF
      ELSE
         MESSAGEBOX("MEMBERDATA not setup correctly - ASELOB", 16, "Class Script")
      ENDIF          
   ELSE
      MESSAGEBOX("MEMBERDATA not setup correctly - AMEMBERS", 16, "Class Script")
   ENDIF
ENDIF 
RETURN
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform