Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to define a collection within a custom class?
Message
From
24/04/2001 11:22:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/04/2001 11:09:13
Larry Long
ProgRes (Programming Resources)
Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00499048
Message ID:
00499059
Views:
18
>How do I go about adding a collection to a custom class's definition?
>
>What a want is something like...
>
>DEFINE CLASS ViewInfo AS Custom
>Name=''
>ADD Object FieldInfo AS Collection
>FieldInfo.FieldName=''
>FieldInfo.FieldCaption=''
>FieldInfo.Updatable=.f.
>ENDCLASS
>
>Where I can declare multiple instances of the FieldInfo Object containing info for each field in the view, etc...
>
>Any ideas?
>
>TIA,
>Larry

Larry,
Could it be an array ? If so :
define class ViewInfo as Relation
dimension FieldInfo[1]
 procedure ClearInfo
 dimension this.FieldInfo[1]
 this.FieldInfo =.F.
endproc
 procedure FillInfo
 lparameters tcAlias
 select (tcAlias)
 dimension this.FieldInfo[reccount()]
 scan
  scatter name this.FieldInfo[recno()]
 endscan
Endproc
enddefine
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform