Home Information PDF Documents EULANDA Handbooks Training Book's corner Download Contact us Table of Contents About us

Glossary

Password needed Newsgroup

Remote Support system

StringList Object (iScript)

Back | Level back

The String-list Help-Object serves as memory for texts, which consist of several lines. The individual lines can be accessed over its ordinale position (index of zero beginning).

Methods

  • procedure LoadFromFile(const FileName: WideString) - load a text file
  • procedure SaveToFile(const FileName: WideString) - save a text file
  • procedure Add(const S: WideString) - add a text line
  • procedure Clear - delete all lines
  • procedure Delete(Index: Integer) - delete a certain line number
  • procedure Insert(Index: Integer; const S: WideString) - insert a line at a certain position
  • procedure Exchange(Index1: Integer; Index2: Integer) - exchange two lines
  • procedure Sort(Options: OleVariant) - sort the list
     

Characteristics

  • property Strings[Index: Integer]: WideString  - access of a certain line number
  • property Text: WideString - all lines with connected line pagings
  • property Count: Integer readonly -  number of lines

A. Example

Application example  of the kernel functions of the string list object

VBScript
dim s, SL

' Creates a new string list object 
Set SL = CreateObject("Eulanda.StringList")

' Adds three text lines 
SL.Add "Bananas"
SL.Add "Oranges"
SL.Add "Apricots"

' Sort the list
SL.Sort

' Shows the sorted text
MsgBox SL.Text 

'  The third line (! Index 2, because the index begins with 0 ) is manipulated 
s = SL.Strings(2)
s = s & "-juice"
SL.Strings(2) = s
' Alternatively you could write the last action as SL.Strings(2) = SL.Strings(2) & "-juice"  

' Renewed indicate of the text
MsgBox SL.Text 

' Save the text on the local memory 
SL.SaveToFile "C:\Obst.txt" 

' Release of the object 
Set SL = Nothing