Rapid-Q Documentation by William Yu (c)1999 Appendix A: QSTRINGLIST


QSTRINGLIST Component

QStringList is a component to store and manipulate a list of strings.

QStringList Properties
Field Type R/W Default Support





Duplicates INTEGER RW dupIgnore W
Item ARRAY of STRING RW WXG
ItemCount INTEGER R WXG
Sorted INTEGER RW False W
Text STRING RW WXG

QStringList Methods
Method Type Description Params Support





AddItems SUBI Add strings to stringlist STRINGs, Infinite WXG
AddList SUB (List AS QStringList) Append another stringlist 1 WXG
Build FUNCTION Build(Start%, End%, Delim$) AS STRING Returns a deliminated string 3 WXG
Clear SUB Clears entire stringlist 0 WXG
DelItems SUBI Delete strings by their index Index #s, Infinite WXG
Exchange SUB (Index1%, Index2%) Swap strings at Index1% with Index2% 2 WXG
IndexOf FUNCTION IndexOf%(String$) Return Index number of string 1 WXG
InsertItem SUB (Index%, String$) Insert string at Index% 2 WXG
LoadFromFile SUB (File$) Load text file in stringlist 1 WXG
LoadFromStream SUB (File AS QStream) Load file/memorystream in stringlist 1 W
Parse FUNCTION Parse(Source$, Delim$) AS LONG Separates strings by the Delim$ and stores each item in the list 2 WXG
SaveToFile SUB (File$) Saves stringlist to file 1 WXG
SaveToStream SUB (File AS QStream) Load file/memorystream in stringlist 1 W
Sort SUB Sort the stringlist 0 WXG

QStringList Events
Event Type Occurs when... Params






QStringList Examples
  DIM StringList1 AS QStringList
  DIM StringList2 AS QStringList

  StringList1.AddItems "Oranges","Apples"
  StringList2.AddItems "Byte","Word","Integer"
  StringList1.AddList(StringList2)
  StringList1.Sort

  ?StringList1.Text
  ?StringList1.Item(3)
  ?StringList1.IndexOf("Word")
  ?StringList1.IndexOf("hi")

  '-------------------------------------------------------

  DIM StringList AS QSTRINGLIST

  StringList.Parse("James:Brown:555-3454:House",":")

  PRINT StringList.Build(0,StringList.Count-1,",")

Prev ComponentContentsNext Component