
GetListOfItems(sourceString,itemDelimiterASCIICode) - where sourceString is the string to
operate on, itemDelimiterASCIICode is the ASCII value (charToNum) of character to use for the
item delimiter. Returns a list of items delimited by the itemDelimiterASCIICode specified or
empty list if there was an error.
Divides a string into a list of pieces delimited by any character. Get the ASCII code needed by
using chartonum() on any typeable character in the message window or refer to the ASCII chart.
Note: A string that begins with the specified item delimiter will create an empty item at the
beginning of the list. The old TextCruncher did not create an empty item. This change was made
to keep TC consistent with Director's item handling and also to preserve information that would
otherwise be lost. For instance, if the string was a data record, the empty item would signify an
empty data field and should be retained.
Example 1:
set phonenum = "891-752-3344"
put chartonum("-")
-- 45
set phonepieces = GetListOfItems(phonenum,45)
put phonepieces
-- ["891", "752", "3344"]
set areacode = getAt(phonepieces,1)
put areacode
-- "891"
Example 2:
on readInDataFile theFilePath, keyFieldNumber
-- Reads in tab-delimited data file and converts it
-- to a list indexed on the specified key field
-- Code assumes that record fields are delimited by
Online Help
39
Komentáře k této Příručce