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


QSTRINGLIST Компонент

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

QStringList Свойства
ПолеТипR/WПо умолчаниюПоддерживается





DuplicatesINTEGERRWdupIgnoreW
ItemARRAY of STRINGRWWXG
ItemCountINTEGERRWXG
SortedINTEGERRWFalseW
TextSTRINGRWWXG

QStringList Методы
МетодТипОписаниеПараметрыПоддерживается





AddItemsSUBIAdd strings to stringlistSTRINGs, InfiniteWXG
AddListSUB (List AS QStringList)Append another stringlist1WXG
BuildFUNCTION Build(Start%, End%, Delim$) AS STRINGВозвращает a deliminated string3WXG
ClearSUBClears entire stringlist0WXG
DelItemsSUBIDelete strings by their indexIndex #s, InfiniteWXG
ExchangeSUB (Index1%, Index2%)Swap strings at Index1% with Index2%2WXG
IndexOfFUNCTION IndexOf%(String$)Return Index number of string1WXG
InsertItemSUB (Index%, String$)Insert string at Index%2WXG
LoadFromFileSUB (File$)Load text file in stringlist1WXG
LoadFromStreamSUB (File AS QStream)Load file/memorystream in stringlist1W
ParseFUNCTION Parse(Source$, Delim$) AS LONGSeparates strings by the Delim$ and stores each item in the list2WXG
SaveToFileSUB (File$)Saves stringlist to file1WXG
SaveToStreamSUB (File AS QStream)Load file/memorystream in stringlist1W
SortSUBSort the stringlist0WXG

QStringList События
СобытиеТипПроисходит когда...Параметры






QStringList Примеры
  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,",")

Предыдущий Компонент Содержание Следующий Компонент