Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can not get it right
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092465
Message ID:
01092492
Views:
21
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform