Journal.line

From OpenEUO
Revision as of 20:40, 8 January 2011 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local j = sl.journal() later local r1,r2,r3 = j.line(pos[,split]) Argument pos is a number, the absolute position of the line to read split (option...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Calling Pattern

Call

local j = sl.journal()

later

local r1,r2,r3 = j.line(pos[,split])

Argument

pos is a number, the absolute position of the line to read
split (optional) is a boolean, defaults to false

Results

r1 is a string, the line at the position specified 
r2 is a number, the associated color
iff split is true then
r3 is the name split from the beginning of the line, if any

Description

Line returns the line stored at the provided absolute position pos. The first message is at position 1, the last message is at j.count(). If pos is outside the range of currently stored lines, then line returns nil.

Note: since line does not update the internal store, refresh should be called periodically to add any new journal entries.

See Also