Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can not get it right
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01092465
Message ID:
01092492
Vues:
20
>>Add is a custom method of the class, which basically adds a new passed object by the name of the specific class.
>
>But you're not passing object into it.

I'm passing the name of the object to add. Here is a code from Add method of the class:
*-- Since bars can be added and removed dynamically, care must
*-- be taken not to accidentally redefine an exising bar. 
IF INLIST(UPPER(tcClass), "CWINDOWBAR", "CSEPARATORBAR")
  *-- Get the last bar number
  IF CNTBAR(this.Name) <> 0 AND UPPER(tcClass) = 'CWINDOWBAR'
    lnBarNumber = GETBAR(this.Name, CNTBAR(this.Name)) + 1
  ENDIF
  lcSuffix = ALLT(STR(ABS(lnBarNumber)))
ENDIF

DO CASE
  CASE PCOUNT() = 2
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name)
  CASE PCOUNT() = 3
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name, tuParm1)
  CASE PCOUNT() = 4
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name, tuParm1, tuParm2)
  CASE PCOUNT() = 5
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name, tuParm1, tuParm2, tuparm3)
  CASE PCOUNT() = 6
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name, tuParm1, tuParm2, tuparm3, tuParm4)
  CASE PCOUNT() = 7
    this.AddObject(tcObjectName + lcSuffix, tcClass, lnBarNumber, this.Name, tuParm1, tuParm2, tuparm3, tuParm4, tuParm5)
  OTHERWISE 
    RETURN .F.
ENDCASE
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform