Text: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 45: Line 45:


<noinclude>
<noinclude>
[[Category:Field Specifications]]
[[Category:Format Specifications]]
[[Category:All Parameters]]
[[Category:All Parameters]]
</noinclude>
</noinclude>

Latest revision as of 17:06, 9 July 2018

TEXT FIELD FORMAT

As of 4.3

10  (R)INPUT FIELDS “row, col, TEXT rows/cols[/capacity],  leading-attr,  …”:

This format is similar to the C/V/G format with the ^ENTER_LF attribute except: No trailing space padding or trimming occurs.

Rows and columns are specified. Field capacity or newlines can cause a vertical scrollbar to appear.

Supported leading attributes are ^ENTER_LF (the default), ^ENTER_CRLF and ^NOWRAP. The TEXT keyword will imply ^ENTER_LF unless ^ENTER_CRLF is specified.

^ENTER_LF (the default) causes the ENTER key to add LF characters to the data and to go to a new line left justified. The cursor will retrace the data when backspace or left-arrow is keyed, meaning the on-screen LF characters are represented by moving the cursor, instead of allowing it to rest on invisible LF characters.

^ENTER_CRLF may be specified in lieu of ^ENTER_LF. When that is the case, carriage returns entered are represented in the data as carriage-return-linefeed (CRLF) character pairs. ^NOWRAP may be specified to suppress word wrapping. When ^NOWRAP is active, data is entered on the current line until ENTER is keyed to go to the next line. Both horizontal and vertical scroll bars appear as needed.

Tabs are entered into the text. Shift-tab is ignored.

Home, End and the arrow keys all operate relative to the current line as opposed to operating on the text box as a whole.

Depressing the Control key causes the following keys to operate in the normal string entry mode:

  • Enter – Returns control to the BR program
  • Tab – Goes to the next control
  • Shift-Tab – Goes to the prior control
  • Home – Goes to the beginning of data or the first field
  • End – Goes to the end of data or the last field
  • Left-Arrow/Up-Arrow – Goes to the prior control
  • Right-Arrow/Down-Arrow – Goes to the next control
  • CurPos introduced.


A sample program to demonstrate TEXT entry is:

01000 ! Rep Text
01020 ! Test New Text Field Type
01040    dim TEXT$*300, TEXT$(1)*80
01060    print NEWPAGE
01080    rinput fields "3,10,text 4/40/300,uh": TEXT$
01100    print fields "10,10,c": TEXT$
01120    print TEXT$
01140    let STR2MAT(TEXT$, MAT TEXT$, CHR$(10))
01160   print MAT TEXT$