listparser

Parses a string list.

Methods

add(s)

Adds a string

clear()

Clears the list (deletes all lines)

curdelete()

Deletes the current line

indexof(s)

Returns the line of a string. If not found, returns -1
returns: integer

load(s)

Loads a string list from a string

loadfromfile(filename)

Loads the list from a file

parsing()

Returns true while still parsing the list
returns: boolean

reset()

Stops parsing the list, goes back to the beginning

savetofile(filename)

Saves the list to a file

stop()

Stops parsing the list

Properties

commatextstringGets (or sets) the list from a comma string
countintegerReturns the number of strings in the list
curindexintegerReturns the index of the current string
currentstringGets (or sets) the current string
textstringGets 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