Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple business object utility or class?
Message
 
To
25/09/2008 09:35:33
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01350261
Message ID:
01350523
Views:
28
Can't remember, maybe with VFP6? but not sure.


>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.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform