Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Basic Fundamentals
Message
 
À
18/07/2001 02:33:03
Ashish Patel
Hindustan Petroleum
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00531871
Message ID:
00531999
Vues:
10
>1. I want to create a non-visual class. First of all is this the right situation to create a class or not pl. clarify that also.
>
> In my project I am having 4 differnt forms which has grid on it. Now when I input some value on tenth colum of any row it will search a table for that value and display the name from that table.
>
> Since I want to do this in all the 4 forms I thought class will be a good idea. Is it Ok ?

Yes. Subclass a grid and drop it on any form you like.

>2. Now if yes the question is how to create a class. I am referring to a book "Special edition using visual FoxPro 6" by "QUe". It has explain how to create class by giving an example of one prg file which first shows how to call a class's function with some value which is what I want to do. But at the end part of prg file it shows the syntex as
>DEFINE CLASS test as custom
> FUNCTION testfunc (Parm1)
> Parm1 = 10
> ENDFUNC
>ENDDEFINE
>
>If this way I have to copy the class in all the form where I want to use the function then there is no point of using it. Isn't is ? Now after few pages it talks about using Visual Class Designer with the command CREATE CLASS and Press ENTER which shows a window for creating class. Till that it is ok. Now what ? Where to write the function and how to pass parameters to it ?

Once you have a prg. Then,

SET PROCEDURE TO My.prg ADDITIVE
oTest = createobject('test')
oTest.testfunc(10)

This won't do anything the way you wrote it except return .T.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform