Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple business object utility or class?
Message
De
25/09/2008 09:35:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01350261
Message ID:
01350521
Vues:
16
Ahhh.... That "SCATTER NAME" is the key. Very cool.

What version of VFP did that come with?

I quit using scatter long ago, so I never even knew that was there.

Thanks for this great insight!



>
>SET ASSERTS ON
>
>lcTable = GETFILE()
>ASSERT .f. 
>oJob = CREATEOBJECT([TableInfo])
>oJob.TableName = JUSTSTEM(lcTable)
>oJob.GetInfo([SomeValue],[TheOrder])
>
>
>DEFINE CLASS TableInfo AS Session
>   Fields        = NULL
>   TableName = []
>   
>   FUNCTION GetInfo(leSeekExpression, lcOrderName)
>            SELECT (this.TableName)
>            SEEK  leSeekExpression IN (this.TableName) ORDER &lcOrderName
>            IF FOUND(this.TableName)
>               SCATTER NAME this.Fields
>            ELSE 
>               this.Fields = NULL
>            ENDIF
>   ENDFUNC                          
>  
>   FUNCTION TableName_Assign(leNewValue)
>           IF NOT USED(leNewValue)
>               USE (leNewValue) IN 0
>           ENDIF
>           this.TableName = m.leNewValue
>  ENDFUNC
>ENDDEFINE
>
>
>
>
>Sure that is a VERY rough class but that is just an idea you should put Error handling, check for reliable parameters etc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform