Documention for: pager.r
Created by: btiffin
on: 1-Mar-2008
Last updated by: btiffin on: 1-Mar-2008
Format: html
Downloaded on: 28-Mar-2024

Usage document for %pager.r

1. Introduction to the REBOL more less pager
2. pager At a Glance
3. Using %pager.r
3.1. Application keys
3.2. Options
3.3. Help
4. Some advanced 'features'
5. Credits

1. Introduction to the REBOL more less pager

This library script is for supporting REBOL console development and capturing output for perusal.

2. pager At a Glance

Note; more, less, page, and pager are all defined

 >> more system
 >> more %myfile.r
 >> more/num/cap [repeat i 100 [print ["Radius" i "Area:" i * i * pi] ] ]
 

3. Using %pager.r

Including this tool is simple. Just DO it.

 >>do %pager.r
 

or to execute this right out of the rebol.org library

 >>do http://www.rebol.org/cgi-bin/cgiwrap/rebol/download-a-script.r?script-name=pager.r
 

3.1. Application keys

q Quit out
b Back a page
Enter, down arrow Advance one line
Backspace, Up arrow Back one line
digit '1' to '9' Advance n lines
> To bottom
< To top
/ Find forward
? Find reverse
g Goto line
n Find next forward
p Find previous backwards
w weefresh screen
h help and info

3.2. Options

num: logic! on or off for display of (source file) line numbers
eof: logic! true waits at end of file
rows: integer! The console is queried for this, but it can be overridden
cols: integer! Override the value the console reports

3.3. Help

 >> help pager
 USAGE:
     PAGER intake /options electives /cap /n /num

 DESCRIPTION:
      supports b, <, >, w, /, ?, q while paging
      PAGER is a function value.

 ARGUMENTS:
      intake -- input data or filename (Type: any)

 REFINEMENTS:
      /options -- rows: cols: integer!, eof: num: logic!
          electives -- (Type: block)
      /cap -- input becomes block to evaluate and capture prin/t]
      /num -- shortcut (and override) for /options [num: on]
 

4. Some advanced 'features'

5. Credits

%pager.r Original author: Brian Tiffin