Begin text block ([Keep current contents][,Carriage return][,Linefeed])
| Command group | Flag affected | Reversible | Execute on client | Platform(s) |
|---|---|---|---|---|
| Text | NO | NO | YES | All |
Begin text block ([Keep current contents][,Carriage return][,Linefeed])
Begin text block ([Keep current contents][,Carriage return][,Linefeed][,Local])
| Keep current contents | If specified, the command keeps the current contents of the text block rather than setting it to empty |
| Carriage return | If specified, Omnis appends a carriage return after it appends the text from a Line: command in the block. If the Carriage return and Linefeed options are both omitted then Omnis appends a platform newline after each Line: command |
| Linefeed | If specified, Omnis appends a line feed after it appends the text from a Line: command in the block. If the Carriage return and Linefeed options are both omitted then Omnis appends a platform newline after each Line: command |
| Local | If specified, this command builds a local text block, which is discarded when the method returns. No other method, including one it calls, can see or change it, and the shared text block is left untouched |
This command defines the start of a block of text to be stored in the text buffer for the current method stack. The Begin text block command clears the text buffer by default, and adds the text in subsequent Line: and Text: commands to the text buffer. However, you can keep the current contents of the buffer by checking the Keep current contents option, in which case text is appended to current text in the buffer
You build the text block using the Line: and Text: commands, which support leading and trailing spaces and can contain square bracket notation.
The Carriage return and Linefeed options specify the line delimiter added after each Line: command; if you omit both of these options, Omnis adds the platform specific newline character sequence after each Line: command.
The End text block command defines the end of the text block, and you can return the contents of the text buffer using the Get text block command.
Without the Local option, there is a single text buffer for each thread, shared by every method running on it. A method you call while you are building a text block, which uses a text block of its own, therefore replaces your text. The Local option gives the method that executes Begin text block a local text buffer. The Line:, Text: and Get text block commands in that method use it, until the method returns or executes Begin text block without the Local option. No other method, including one it calls, can see or change it, and the shared text block is left untouched. Keep current contents keeps the contents of the method's local text block, never the shared one. You can still use Get text block after End text block.
It is recommended that you use the Local option unless another method deliberately adds to the same text block, for example a method that adds lines to a text block begun in the method that called it. That needs the shared buffer, so the method that begins the text block must not use Local.
Begin text block
Text: Thought for the day: (Carriage return)
Text: If a train station is where the train
Text: stops, what is a work station?
End text block
Get text block lTextString
OK message {[lTextString]}