OM# Documentation

TEXTBUFFER

TEXTBUFFER is a box used to store and edit texts or other data in OM#.

The contents is set or read through the contents input/output of the TEXTBUFFER box. It can be edited text by opening the box editor.

Initialization / setting contents

Contents is interpreted either as numbers, symbols or lists.

By default the TEXTBUFFER interprets list inputs in contents 1- or 2-dimensinal arrays, converted to as many lines of text: each item becomes a new line, and if the elementitem is a list, each sub-item in this list becomes a new element in the same line.

The additional input input-modes allows selecting different ways of interpreting the input data:

The two other options are:

Loading from disk / Saving to disk

A TEXTBUFFER can also be initialized from an existing text file, by connecting the file path to the first/self input of the box.

The contents of a TEXTBUFFER can also be saved to disk at any time using the “Save” menu of the text editor, or using the save-as-text function:

Reading contents

TEXTBUFFER contents can be read through the contents output.

The default reader behaviour is to interpret the contents as a 2-dimentional array (a list of list) and return a nested list of lines, where each line is a list of data.

Other options are also proposed through the other additional “box-attributes” input:

With the example above:

1 1 1
(2 3 4)
hello

TEXTBUFFER contents can also be read using the textbuffer-read function (connected to the first / self output of the box), which provides the same reading options in its second input.

Lisp

The contents of the TEXTBUFFERcan be evaluated as Lisp code using the textbuffer-evalfunction:

Note: Using dedicated tools like the Lisp Fuction box can be more appropriate to type in and evaluate Lisp functions.