Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another try, classes
Message
De
30/06/2004 19:56:10
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00919427
Message ID:
00919443
Vues:
13
>I I do this -- In line 2, the hello() executes. But thereafter, how do I call Hello()?
>
>SET CLASSLIB TO C:\page0\pager && 1
>oPager = newOBJECT("hello") && 2
>
>Thanks
>Steve

You need to execute some method of your Hello class.

Let me show you programmatically:
* hello.prg
*
oHello = CREATEOBJECT("Hello")
oHello.SayHi()


DEFINE CLASS Hello AS Custom
  FUNCTION SayHi
    MESSAGEBOX("Hi there, from the Hello.SayHi() method!")
  ENDFUNC
ENDDEFINE
This is a little different thatn a class library, but if you were to add the custom method "SayHi" to your Hello class, the only differences is that in a visual class library when you add a method, you do not put in the FUNCTION SayHi/ENDFUNC lines and you need to have the SET CLASSLIB command in order for VFP to find your class.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform