Textutils (API)

From ComputerCraft Wiki
Revision as of 01:30, 13 April 2013 by 1lann (Talk | contribs) (Added description for pagedTabulate)

Jump to: navigation, search
This page needs some serious TLC, stat!
Please help us by cleaning it, fixing it up, or sparing it some love.
(Reason: Needs 5 3 function pages, 1 function descriptions. AfterLifeLochie 02:40, 29 November 2012 (MSK))

The Textutils API is used to format and manipulate strings easily.

Grid disk.png   Textutils (API)

Method NameDescription
textutils.slowPrint(string text, int rate) Slowly prints the text. Only difference is, it leaves a new-line after it.
textutils.slowWrite(string text, int rate) Slowly writes the text.
textutils.formatTime(int time, bool TwentyFourHour) Put a time into it, and it spews it out in a different format. Example: print(textutils.formatTime(os.time(), false))
textutils.tabulate(table table, table table2, ...) Prints tables in an ordered form. Each table is a row, the column(s)' width is auto-adjusted.
textutils.pagedTabulate(table table, table table2, ...) Prints tables in an ordered form, like textutils.tabulate. However it waits for conformation before scrolling down..
textutils.pagedPrint(string text, string confirmation_lines) Prints string text onto the screen, but waits for confirmation before scrolling down.
textutils.serialize(table table) Returns a string representation of the table table for storage or transmission.
textutils.unserialize(string text) Returns a table reassembled from the string text.
textutils.urlEncode(string text) Makes a string safe to encode into a url. Spaces are replaced with +s. Unsafe characters such as '\', '£' and '}' are translated into ASCII code and preceded with a % for transmission. For reference visit: [1].