Table of Contents

Text File Section

The Text Section is one of the sysop-configurable loadable modules: the module executed to present the Text File Sections (sometimes called “G-Files”) to the Terminal server users.

The name of the Text Section module (by default, text_sec) is configured in SCFG->System->Loadable Modules->Text Section.

The default Text Section module is exec/text_sec.js, described on this page: it displays a list of the sections the user has access to and, for the section chosen, a list of its text files to read.

Install

The stock module needs no installation: text_sec is the default value of SCFG->System->Loadable Modules->Text Section.

A sysop may replace it in either of two ways:

With a different module configured, the remainder of this page (the keys, modopts.ini options, text strings and menu files) applies only so far as that module implements it.

Invoke

The configured Text Section module runs whenever the Baja TEXT_FILE_SECTION function or the JS bbs.text_sec() method is invoked, e.g. by a command shell's Text Files command. The stock module takes no arguments.

Use

Both lists are numbered and are answered the same way:

Key Action
an item number Choose that section, or read that file
Up / Down arrow Move the selected item, or scroll the list when no selected item is marked (new in v3.22)
Home / End Move to the first / last item (new in v3.22)
PgUp / PgDn Display the previous / next page of a list that is longer than the screen (new in v3.22)
F (or /) Find: prompts for a boolean search expression and moves the selected item to the next item that matches, when a selected item is marked (new in v3.22)
N / P After a Find: move to the next / previous match. Otherwise: the next / previous page, like PgDn / PgUp (new in v3.22)
Enter Choose the selected item, when one is marked. Otherwise: quit the section list; in a file list, read the file after the one last read (or quit, when none has been read)
the Quit key (Q) Return to the section list, or leave the Text File Sections
Backspace or Left arrow The same as the Quit key (new in v3.22)
Right arrow Choose the selected item, when one is marked (new in v3.22)
? Redisplay the file list

Find searches the section names or, in a file list, the descriptions and filenames, wrapping around from the end of the list to its start. While it is available the prompt names its keys, e.g. Which, Find, or Quit: and, once there has been a search, Which, Find, Next, Prev, or Quit:. Those words are the Find, Next and Previous text strings. Find requires a selected item, so it is not offered in a list that marks none, nor in a menu file displayed in place of a list.

A list that does not fit on the screen is displayed a page at a time, with an indicator of the items displayed (e.g. [1-20 of 57]) below it. Each item is also a mouse hot-spot for its number.

In a file list, the sysop has three more commands:

Key Action
A Add a file to the list, before the chosen item: prompts for the file's path/filename (a file that does not exist may be created with the editor) and its description
R Remove a file from the list, and optionally delete the file
E Edit a file's description, and optionally the file itself

The lists of files are stored in the section .ini files described in Text File Sections.

Configure

The stock text_sec module supports the following configuration options (new in v3.22) in the [text_sec] section of the ctrl/modopts.ini file:

Option Default Description
selected_item_prefix none Displayed before the selected item of a list, e.g. "\x01U->"
unselected_item_prefix none Displayed before every other item, normally spaces of the same width as selected_item_prefix
selected_item_attr none The color, as attribute letters, that highlights the name of the selected item, e.g. V (the mnemonic color), or K7 for a reverse-video bar
more_fmt "\x01n\x01h\x01k [%u-%u of %u]" Format of the indicator displayed below a list that does not fit on the screen: the first and last items displayed and the total

When any of the first three options is set, each list has a selected item: the arrow keys move it and Enter chooses it. In a file list it starts on the first file and moves to the next file each time one is read. The modopts.ini file of a new installation sets all three:

[text_sec]
	selected_item_prefix: "\x01U->"
	unselected_item_prefix: "  "
	selected_item_attr = V

With none of them set (as in a modopts.ini file from before v3.22), no item is marked, the lists look as they did in v3.21 and the navigation keys only scroll a list that is longer than the screen.

Text

The headings, items and prompts of the lists are the text strings with these IDs, customized by adding a line for each to the ctrl/text.ini file (not by editing the text.dat file, which holds their default values):

Text ID Use
TextSectionLstHdr Heading of the section list
TextSectionLstFmt A section: its number and name
WhichTextSection Prompt below the section list
TextFilesLstHdr Heading of a file list: the section name
TextFilesLstFmt A file: its number and description
WhichTextFile Prompt below a file list
WhichTextFileSysop Prompt below a file list, for the sysop

The name of the selected item is highlighted (with selected_item_attr) only when the item's format displays the name with a plain %s, as the default TextSectionLstFmt and TextFilesLstFmt strings do. A format customized to use a field width for the name is displayed without the highlight, rather than misaligned.

A menu file may be displayed in place of a generated list: text_sec in place of the section list, and text<x> in place of the file list of section number <x> (one-based). Such a list is answered by number only: there is no selected item and the navigation keys are not used.

A menu file whose items are marked with the @BAR lightbar @-codes is a lightbar menu instead: the arrow, Home and End keys move a highlight bar from item to item and Enter chooses the highlighted one. Where the items are all in one column, the Right arrow key chooses the highlighted item too and the Left arrow key backs out, like the Quit key. Backspace backs out of any such menu. Each item's cmd is what the user could type instead: an item number, the Quit key or another of the list's command keys (e.g. ?). See Lightbar Menus for an example.

See Also