Klik op het logo voor hulp op afstand
  
 
 
 
 
 
 
 




STRINGS class


The STRINGS class implements an in-memory list of strings. (eg. text) It can be used to:
  • maintain a list of string values
  • to sort a list of string values 
  • load textfiles into memory
  • create a textfile                     

 
Constructor
 
CREATE ()
Returns an instanciated strings object
 
Destructor
 
FREE ()
Frees the strings object
 
Methods
 
ADD (S) : Dndx
Add a string to the end of the list
 
CLEAR ()
Clear all the strings in the list
 
DELETE (Dndx)
Delete the string at the specified index
 
EXCHANGE (Dndx1,Dndx2)
Swap the strings at the specified indexes
 
INDEXOF (S) : Dndx
Returns the index of a specific string, -1 means the strings was not found
 
INSERT (Dndx,S)
Insert the given string at the specified index
 
SORT ()
Sort the strings in the list
 
LOADFROMFILE (Sfn) : B
Load a textfile into the list, each textline takes an entry in the list
 
SAVETOFILE (Sfn) : B
Saves the strings in the list to a textfile
 
CLONE : O
Returns a duplicate of the list
 
LOADDIR(Sspec,Dattr,Bnamesonly) : B
LoadDir methode van Strings object verwacht 3 parameters :
Sspec = specificatie van folder
Dattr = geldige bestand attributen
Bnamesonly = bestandsnaam (0=naam+extensie, 1=naam alleen)
File attribute constanten in scripting:
ATTR_READONLY
ATTR_HIDDEN
ATTR_SYSFILE
ATTR_VOLUMEID
ATTR_DIRECTORY
ATTR_ARCHIVE
ATTR_SYMLINK
ATTR_ANYFILE
 
bvb: Strings.LoadDir(“C:\TEST”, ATTR_ANYFILE,0);
 
Properties
 
COUNT 
Returns the number of strings in the list
(read-only)
 
STRINGS[ndx]
To access a specific string in the list. The index specified should be in the range
0=nCount
 
TEXT
Returns the contents of the list as a single string. Lines in the string are separated by CRLF pairs.
 
DELIMITER
Specifies the delimiter used by the DelimitedText property.
 
QUOTECHAR
Specifies the quote character used by the DelimitedText property.
 
COMMATEXT
Lists the strings in the STRINGS object in system data format (SDF).
 
DELIMITEDTEXT
Represents all the strings in the STRINGS object as a single delimited string.
 
STRICTDELIMITER
Determines how the Delimiter property is used.
 
VALUES
Returns/Sets the value for a given name when using name/value pair strings

 

Example:

myText := Strings.Create();
myText.Add('Hello');
myText.Add('from');
myText.Add('JoPPS-Script');
myText.SaveToFile('mytext.txt');
myText.Free();

 

 

 



 |  History  |
 
 

 
 
 
TECHWIN SOFTWARE
De Regenboog 11
B-2800 Mechelen
T +32(0)15 44 64 64
T +31(0)30 899 32 15 Nederland