Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple String Collection
Message
De
15/12/2007 19:19:19
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
14/12/2007 17:42:51
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01276037
Message ID:
01276123
Vues:
26
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform