Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does FoxPro 6.0 handle collections? - Again
Message
From
30/09/1998 15:12:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00139271
Message ID:
00142528
Views:
23
Tim ---

Far out! That is essentially what I was trying to impart...but I'm glad it all came to fruition.

>I finally got it to work! Here is a simple example. First create an Active-X DLL in Visual Basic with the following for the Class Module:
>
>Public Function Create() As Variant
> Dim loCollection As New Collection
>
> loCollection.Add "One", "String"
> loCollection.Add "1", "Character"
> loCollection.Add 1, "Integer"
> loCollection.Add #1/1/98#, "Date"
> loCollection.Add 1.12, "Float"
>
> Set Create = loCollection
>End Function
>
>Under the projects properties, name the project Test and the Class Module Tools. Afterwards, compile to a DLL.
>
>In Visual FoxPro, do the following:
>
>oTest = CREATEOBJECT("Test.Tools")
>oCollection = loTest.Create()
>
>? oTest.Count && Returns 5
>? oCollection.Item(1) && Returns "One"
>? oCollection.Item("String") && Returns "One"
>= oCollection.Add(DATETIME(), "Time") && Adds current date and time
>= oCollection.Remove(1) && Removes key "One"
>? oCollection.Item(1) && Returns 1
>
>Thanks for your help!
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Reply
Map
View

Click here to load this message in the networking platform