Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple String Collection
Message
From
15/12/2007 19:19:19
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/12/2007 17:42:51
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01276037
Message ID:
01276123
Views:
27
>I have had my head out of VFP for a while, so I am sorry for the simple question.
>
>What is the easiest and quickest way to make a simple collection of strings? Something similar to a .NET StringCollection is what I am looking for. It must be variable length also.

Mike,
What type of string collection you need and approximate count of strings?
In VFP there are many alternative ways, including cursors. You can create a class to almost create one to one copy of its members. Here is a simple alternative to basic usage w/o having all member methods:
Dim myArr() As String = {"RED", "orange", "yellow", "RED", "green", "blue", "RED", "indigo", "violet", "RED"}
      myCol.AddRange(myArr)
alines(myArr,;
 "RED,orange,yellow,RED,green,blue,RED,indigo,violet,RED", ;
 .t.,",")

* for each ...
* for ix = 1 to ...
* ascan(myArr, ...
* dimension ...,acopy(),asort(), ains(),adel(), ...

dimension myArr[alen(myArr),1]
create cursor myStringcollection (myString c(254))
append from array myArr
* and use powerfull cursor based operations which cover all and more of StringCollection members
Also, though weird, a combobox class could be initialized with a RowSourceType of value and RowSource = commma separated string list. It works exceptionally fast if strings are small and the listcount is not huge.

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
Reply
Map
View

Click here to load this message in the networking platform