listparser
Parses a string list.
Methods
Adds a string
Clears the list (deletes all lines)
Deletes the current line
Returns the line of a string. If not found, returns -1
returns: integer
Loads a string list from a string
Loads the list from a file
Returns true while still parsing the list
returns: boolean
Stops parsing the list, goes back to the beginning
Saves the list to a file
Stops parsing the list
Properties
commatext | string | Gets (or sets) the list from a comma string |
count | integer | Returns the number of strings in the list |
curindex | integer | Returns the index of the current string |
current | string | Gets (or sets) the current string |
text | string | Gets or sets the list of strings |
Usage
list = [[
Turkey
Russia
Azerbaijan
United Kingdom
Montenegro
]]
p = scl.listparser:new()
p:load(list)
while p:parsing() do
print(p.current)
end