Appendix D - BRIEF Macros

The following is the list of available macros for Brief compatibility, formally known as CBRIEF following the later 3.x releases.

Macro
Description
abort
Unconditionally abort BRIEF.
above
Tests greater than for unsigned ints.
above_eq
Tests greater than or equal for unsigned ints.
assign_to_key
Assign command to key or key sequence.
atoi
Convert character to ascii or string to integer.
attach_buffer
Attach a buffer to the current window.
autoload
Notify which file macros or globals are in.
backspace
Move left and delete char.
beep
Make a noise.
beginning_of_line
Move cursor to first column of current line.
below
Tests less than for unsigned ints.
below_eq
Tests less than or equal for unsigned ints.
borders
Toggle window borders.
call_registered_macro
Invokes all registered macros of a given type.
cd
Change current directory.
change_window
Make a different window active.
close_window
Close a window.
color
Set BRIEF screen colors.
compress
Compress consecutive whitespace characters.
copy
Copy marked area to scrap.
copy_keyboard
Copy all or part of a keyboard map.
create_buffer
Create a buffer.
create_edge
Create a new window.
create_tiled_window
Creates a tiled window.
create_window
Create an overlapping window.
cut
Cut the marked area to scrap.
date
Get the system date and time.
del
Delete file.
delete_block
Delete the marked block.
delete_buffer
Remove a buffer.
delete_char
Delete character at cursor location.
delete_edge
Deletes a tiled window edge, closing a window.
delete_line
Deletes current line.
delete_macro
Delete all macros in a macro file from memory.
delete_to_eol
Deletes from cursor to end of line.
delete_window
Delete an overlapping window.
display_windows
Displays tiled windows.
distance_to_tab
Give the number of characters to next tab stop.
dos
Execute a DOS command.
down
Move cursor down one row.
drop_anchor
Begin a marked area.
drop_bookmark
Make a bookmark at the current location.
edit_file
Edit a file.
end_of_buffer
Move to the end of the buffer.
end_of_line
Move to the last character on the current line.
end_of_window
Move to the last line in the window.
error
Show error message on prompt line.
execute_macro
Run a macro.
exist
Check to see if a file exists.
exit
Exit to DOS or return to BRIEF.
file_pattern
Set up a pattern for file searching.
find_file
Search for file names matching file_pattern.
first_time
Detects the first time a macro is executed.
get_parm
Get a passed parameter, prompting if needed.
getwd
Get the working directory name.
goto_bookmark
Move to bookmark, or just get the location.
goto_line
Move to a particular line.
goto_old_line
Move to line before buffer modification.
index
Locate first occurrence of one string in another.
inq_assignment
Get key assignment for function.
inq_borders
Get borders setting.
inq_brief_level
Get number of copies of BRIEF in memory.
inq_buffer
Get current buffer id.
inq_called
Get name of calling macro.
inq_btn2_action
Get the action attached to mouse button 2.
inq_cmd_line
Get text currently on prompt line.
inq_command
Get name of last command invoked from keyboard.
inq_ctrl_state
Get the state of window controls.
inq_environment
Get a value from the DOS environment.
inq_idle_default
Get the default amount of idle time.
inq_idle_time
Get number of seconds since user pressed a key.
inq_kbd_char
Get status of keyboard input buffer.
inq_kbd_flags
Get BIOS keyboard flags.
inq_keyboard
Get current keyboard id.
inq_keystroke_macro
Is keystroke macro record/playback active?.
inq_line_length
Get max line length.
inq_local_keyboard
Get local keyboard id for current buffer.
inq_macro
Find out if a macro exists.
inq_mark_size
Get number of characters in marked area.
inq_marked
Get the boundaries and type of a marked area.
inq_message
Get current message displayed on the prompt line.
inq_mode
Get typing mode: insert or overstrike.
inq_modified
Get modified status for buffer.
inq_mouse_action
Get the name of the current mouse event handler.
inq_msg_level
Get current message level.
inq_names
Get file and buffer name.
inq_position
Get current position.
inq_scrap
Get scrap buffer id and mark type.
inq_screen_size
Get screen size.
inq_system
Find out if a buffer is a system buffer.
inq_top_left
Get buffer positioning information.
inq_views
Get number of windows containing a buffer.
inq_window
Get window id.
inq_window_color
Get window color (borderless only).
inq_window_info
Get buffer id, size and type for a given window id.
inq_window_size
Get height, width, and horiz scroll amount.
insert
Insert a formatted string into current buffer.
insert_mode
Toggle insert/overstrike mode.
int_to_key
Convert an integer to mnemonic key string.
key_to_int
Convert mnemonic key string to an integer.
keyboard_flush
Clear all waiting keyboard input.
keyboard_pop
Pop a keyboard from the keyboard stack.
keyboard_push
Push a keyboard onto the keyboard stack.
keyboard_typeables
Assign self_insert to all typeable keys.
left
Move cursor left.
load_macro
Load a macro file.
lower
Convert a string to all lower case characters.
ltrim
Remove leading white space from string.
mark
Toggle mark state.
message
Display a status message on the prompt line.
move_abs
Move to an absolute location in the buffer.
move_edge
Move a tiled window boundary.
move_rel
Move to a relative location in the buffer.
next_buffer
Get buffer id of next buffer.
next_char
Move cursor to next character.
next_window
Get window id of next tiled window.
nothing
Do nothing; bound to unassigned keys.
output_file
Set name of output file for current buffer.
page_down
Move down a page.
page_up
Move up a page.
paste
Insert scrap buffer at cursor location.
pause_on_error
Toggle pausing execution on every error.
playback
Playback remembered keystrokes.
prev_char
Move to previous character.
print
Print the marked area.
printf
Print message to DOS standard output (debug).
process
Process keystrokes until exit.
push_back
Push back a keystroke for processing elsewhere.
put_parm
Set the value of a passed parameter.
raise_anchor
Remove a marked area.
read
Get characters starting at current location.
read_char
Get the character from the current location.
read_file
Insert a copy of a file into current buffer.
redo
Redo the last undo command.
refresh
Redraw the screen.
register_macro
Add a new registered macro.
remember
Start recording keystrokes.
restore_position
Go back to most recent save_position location.
returns
Just set return value.
right
Move cursor right.
rindex
Locate last occurrence of one string in another.
save_keystroke_macro
Save keystroke macro to file.
save_position
Save a position for use by restore_position.
search_back
Search backward for a pattern.
search_case
Change the case-sensitivity flag.
search_fwd
Search forward for a pattern.
search_string
Search a string for another string.
self_insert
Insert key value (assigned to typeable keys).
set_backup
Controls creation of backup files.
set_btn2_action
Sets the action for mouse button 2.
set_buffer
Sets the current buffer.
set_calling_name
Sets the name of calling function.
set_ctrl_state
Sets the state of window controls.
set_mouse_action
Sets the name of the mouse event handler.
set_mouse_type
Sets the type of mouse.
set_msg_level
Sets the message level.
set_scrap_info
Sets the scrap information.
set_top_left
Position buffer in a window.
set_window
Sets the current window.
sprintf
Formatted print into a string.
strlen
Get length of a string.
substr
Extract a sub-string from a string.
swap_anchor
Exchange cursor and anchor locations.
tabs
Set tab stops.
time
Get current system time.
top_of_buffer
Move to top of buffer.
top_of_window
Move to top of window.
transfer
Direct buffer-to-buffer text transfer.
translate
Translate pattern to a replacement string.
trim
Remove trailing whitespace from string.
undo
Undo the last command.
unregister_macro
Remove a registered macro.
up
Move cursor up one line.
upper
Convert string to upper case characters.
use_local_keyboard
Attaches a local keyboard to current buffer.
use_tab_char
Controls whether tabs or spaces are used.
version
Get version number of BRIEF.
window_color
Set background color for borderless window.
write_block
Write marked block to a file.

$Id: appendixd.txt,v 1.4 2014/10/31 01:09:05 ayoung Exp $

To send feedback on this topic email: grie.nosp@m.fedit@gmai.nosp@m.l.com

Copyright © Adam Young All Rights Reserved.

void abort()
Abnormal process.
int above(declare expr1,
declare expr2)
Greater than comparison.
int above_eq(declare expr1,
declare expr2)
Greater than or equal comparison.
int assign_to_key([string key],
[string macro])
Assign command to key or key sequence.
int atoi(string str,
 [int svalue = TRUE])
Convert string to a decimal number.
void attach_buffer(int bufnum)
Attach a buffer to a window.
void autoload(string filename,
string function,
 ...)
Register location of one or more macros.
void backspace([int num = 1])
Delete character to the left of the cursor.
int beep([int freq],
[int duration])
Issue a beep sound.
int beginning_of_line()
Goto beginning of line.
int below(declare expr1,
declare expr2)
Less than comparison.
int below_eq(declare expr1,
declare expr2)
Less than or equal comparison.
int borders([int borders])
Set window border status.
int call_registered_macro(int type)
Invoke registered macro callbacks.
int cd([string dir])
Change directory.
void change_window([int direction],
[string message])
Selects a new window.
void close_window([int winum])
Close specified the window.
int color([int background],
[int normal],
 [int selected],
[int message],
[int error],
 [int hilite],
[int hilite_fg],
...)
Set the basic colors.
string compress(
   string str,
    [int trim = FALSE],
      [string chars = " \\t\\r\\n"],
    [int replacement = ' ']
)
Compress repeated instances of white-space characters.
int copy([int append = FALSE],
[int keep = FALSE])
Copy marked area to scrap.
int copy_keyboard(int kbdid,
  [string cmd ...])
Copy a keyboard.
int create_buffer(string bufname,
 [string filename],
  [int sysflag = FALSE],
 [int editflags = 0],
  [string encoding = ""])
Create and load a buffer.
int create_edge([int direction])
Create an edge, splitting the window.
int create_tiled_window(int lx,
int by,
int rx,
int ty,
 [int bufnum])
Creates a tiled window.
int create_window(int lx,
int by,
 int rx,
int ty,
 [string message])
Create a popup window.
int cut([int append = FALSE],
[int syscopy = FALSE])
Cut marked area to scrap.
int date([int &year],
[int &month],
[int &day],
 [string &monname],
[string &dayname])
Get current system date.
int del(string name)
Delete a file.
int delete_block()
Deleted selected region.
void delete_buffer(int bufnum)
Delete a buffer.
void delete_char([int num])
Delete character.
int delete_edge([int direction])
Delete an edge, combining a split window.
void delete_line()
Delete current line.
void delete_macro(string macro)
Delete a macro from memory.
void delete_to_eol()
Delete to end-of-line.
void delete_window([int winum])
Delete a window.
int display_windows([int mode])
Control window display.
int distance_to_tab([int column])
Calculate distance to next tab.
int dos([string cmd],
[int use_shell],
[string callback])
Create a sub-shell.
int down([int lines = 1])
Move position down one line.
int drop_anchor([int type = MK_NORMAL])
Start marking a selection.
int drop_bookmark([int bookid],
[string yesno],
 [int bufnum],
[int line],
[int column],
[int local = FALSE])
Create or update a bookmark.
int edit_file(...)
Edit a file.
int end_of_buffer()
Move cursor to end of current buffer.
int end_of_line()
Goto end of line.
int end_of_window()
Goto end of the current window.
int error(string format,
 ...)
Issue an error message on the command line.
declare execute_macro([string cmd],
...)
Invokes a command by name.
int exist(string path,
 [int canon = TRUE])
Check file existence.
void exit([string y_or_w])
Exit current process level.
int file_pattern(string filespec)
Directory file pattern.
int find_file([string &filename],
[int &size],
 [int &mtime],
[int &ctime],
[int &mode])
Read next directory entry.
int first_time()
Determine a macros initialisation status.
int get_parm( [int argument],
declare &symbol,
  [string prompt],
 [int length = MAXPROMPT],
  [declare default],
 [int one = FALSE])
Retrieve the value of a macro parameter.
int getwd(int ignored,
string dir)
Get current working directory.
int goto_bookmark(int bookid =  NULL,
  [int &bufnum],  
 [int &line],  
 [int &column]  )
Seek a bookmark.
int goto_line([int lineno])
Move to a particular line.
int goto_old_line([int oldlineno])
Move to line before buffer modification.
int index(string str,
int ch|string s)
Search string for a leftmost sub-string or character.
string inq_assignment(int|string val,
 [int tokey = FALSE])
Get key assignment for function.
int inq_borders()
Retrieve the border status.
int inq_brief_level()
Retrieve the editor nesting level.
int inq_buffer([string filename])
Retrieve a buffer identifier.
string inq_called()
Get the name of the calling macro.
int inq_btn2_action()
Retrieve the second button action.
string inq_cmd_line()
Retrieve the command line message.
string inq_command()
Retrieve name of last keyboard command.
int inq_ctrl_state(int ctrl,
 [int winnum])
Retrieve the state of a window control.
string inq_environment(string name)
Retrieve an environment variable.
int inq_idle_default()
Retrieve idle interval.
int inq_idle_time()
Retrieve keyboard idle time.
int inq_kbd_char()
Peek at the keyboard.
int inq_kbd_flags()
Get keyboard key flags.
int inq_keyboard()
Retrieve the keyboard identifier.
string inq_keystroke_macro([int macroid],
[int &bufnum])
Retrieve the current keystroke macro.
int inq_line_length([int bufnum])
Determine the longest line length.
int inq_local_keyboard()
Retrieve local keyboard identifier.
int inq_macro(string name,
 [int mode = 0])
Determine whether a macro or primitive exists.
int inq_mark_size()
Retrieve size of marked region.
int inq_marked([int &start_line],
[int &start_col],
 [int &end_line],
[int &end_col])
Determine the current marked region.
string inq_message()
Retrieve the prompt line.
int inq_mode([int bufnum],
[int &localised])
Returns the overstrike mode.
int inq_modified([int bufnum])
Determine a buffers modification status.
string inq_mouse_action()
Retrieve the keyboard mouse handler.
int inq_msg_level()
Get the message level.
int inq_names([string fullname],
[string ext],
 [string bufname],
[int bufnum])
Retrieve associated buffer names.
int inq_position([int &line],
[int &col])
Retrieve current buffer position.
int inq_scrap([int &last],
[int &type])
Obtain the scrap buffer identifier.
int inq_screen_size([int &rows],
[int &cols],
[int &colors])
Determine screen dimensions.
int inq_system([int bufnum])
Determine if buffer is a system buffer.
int inq_top_left([int &top],
[int &indent],
[int winnum],
 [int &line],
[int &col],
[int &bufnum])
Retrieve window view port coordinates.
int inq_views([int bufnum])
Determine window count.
int inq_window()
Retrieve the current window.
int inq_window_color([int winnum])
Retrieve the window attribute.
int inq_window_info([int &winnum],
[int &bufnum],
 [int &lx],
[int &by],
[int &rx],
[int &ty],
 [string &title = NULL],
[string &message = NULL])
Retrieve the current window information.
int inq_window_size()
Retrieve the window size.
int insert(string|int val,
 [int num = 1])
Insert string into current buffer.
int insert_mode([int value],
[int bufnum])
Set the buffer insert/overstrike mode.
string int_to_key(int key)
Convert an keycode to mnemonic key string.
int key_to_int(string key,
int raw)
Convert key name to a code.
void keyboard_flush()
Flush the keyboard buffer.
void keyboard_pop([int save = FALSE])
Pop a keyboard from the keyboard stack.
void keyboard_push([int kbdid])
Push a keyboard onto the keyboard stack.
int keyboard_typeables()
Assign self_insert to all typeable keys.
int left([int columns = 1],
[int wrap = TRUE])
Move position left one charcter.
int load_macro(string filename,
 [int reload = 1])
Load a macro object.
string|int lower(string str|int character)
Convert string or character to lowercase.
string ltrim(string str,
 [string chars = " \\t\\r\\n"])
Chomp characters from the front of a string.
int mark([int type = MK_NORMAL])
Toggle the anchor status.
int message(string format,
 ...)
Display a message on the command line.
int move_abs([int line = -1],
[int column = -1],
 [int bufnum],
[int clip = FALSE])
Move to an absolute location in the buffer.
int move_edge([int direction],
[int amount])
Modify a window.
int move_rel([int lines = 1],
[int cols = 1])
Move to a relative location in the buffer.
int next_buffer([int sysflag = 0],
 [int previous],
[int tab])
Identifier of the next buffer.
int next_char([int characters = 1])
Move to the next character.
int next_window(int winnum)
Obtain the next window identifier.
void nothing()
Noop.
int output_file([string filename])
Change the output file-name.
int page_down([int pages = 1])
Move position down a page.
int page_up([int pages = 1])
Move position up a page.
int paste([int syspaste = FALSE])
Insert scrap buffer at cursor location.
int pause_on_error([int pause = NULL],
[int echo = TRUE])
Set the error display mode.
int playback([int macroid])
Replay a keystroke macro.
int prev_char([int characters = 1])
Move to the previous character.
int print()
Print formatted string to stdout.
void printf(string format,
 ...)
Print formatted string to stdout.
void process()
Invoke a Grief engine.
void push_back(int key,
  [int front],
 [int x],
 [int y])
Push back a character into the keyboard.
int put_parm(int argidx,
 declare val,
 [int optional = TRUE])
Assign an argument value.
int raise_anchor()
Raise the last dropped mark.
string read([int number],
[int &status])
Read characters from the buffer.
void read_char([int timeout = 0],
[int mode = 0])
Read next key from the keyboard.
int read_file([string filename],
 [int glob = TRUE],
[string encoding = NULL])
Read into the current buffer.
void redo()
Redo an undo operation.
void refresh()
Update the display.
int register_macro(int type,
 string macro,
 [int local = FALSE])
Register a callback procedure.
int remember([string|int overwrite],
[int macroid])
Start remembering keystrokes.
int restore_position([int what = 1])
Restore a previously saved position.
returns (expression);
Return an expression from a macro.
int right([int columns = 1],
[int wrap = TRUE])
Move position right one character.
int rindex(string str,
int ch|string s)
Search string for a rightmost sub-string or character.
int save_keystroke_macro(string filename)
Save the current keystroke macro.
void save_position()
Saves current cursor/buffer state.
int search_back(string pattern,
 [int re],
 [int case],
  [int block],
 [int length])
Backwards buffer search.
int search_case([int case])
Set the search pattern case mode.
int search_fwd(string pattern,
 [int re],
 [int case],
  [int block],
 [int length])
Buffer search.
int search_string(string pattern,
string text,
  [int &length],
 [int re],
 [int case])
Searches for a pattern in a string.
void self_insert([int character])
Insert a character as if it was typed.
int set_backup(int mode,
 [int bufnum])
Set backup creation mode.
int set_btn2_action([int action])
Set the second button action.
int set_buffer(int bufnum)
Set the current buffer.
void set_calling_name(string name =  NULL)
Set the name of the calling macro.
void set_ctrl_state(int ctrl,
int state,
 [int winnum])
Set the state of a window control.
int set_mouse_action(string mouse_handler)
Set keyboard mouse handler.
int set_mouse_type()
Sets the mouse type.
int set_msg_level(int level)
Set level of informational messages.
void set_scrap_info(  [int last],
[int type],
[int bufnum])
Set the scrap buffer details.
int set_top_left([int line],
[int column],
 [int winnum],
[int csrline],
[int csrcolumn],
[int bufnum])
Manages window view port coordinates.
int set_window(int winnum)
Set the active window.
int sprintf(string &buffer,
string format,
 ...)
Formatted printing to a string.
int strlen(string|list arg,
 [int step = 1])
String length.
string substr(string str,
 [int offset],
 [int length])
Extract a sub-string.
int swap_anchor()
Swaps the mark with the current position.
int tabs([string tabs | list tabs | int tab, ...])
Set buffer tab stops.
int time([int &hour],
[int &min],
[int &sec],
[int &msec])
Get the current system time.
int top_of_buffer()
Move cursor to start of current buffer.
int top_of_window()
Goto top of the current window.
int transfer(int bufnum,
 int sline,
 [int scolumn],
int eline,
 [int ecolumn])
Buffer to buffer transfer.
int translate(string pattern,
string replacement,
  [int global],
 [int re],
 [int case],
  [int block],
 [int forward])
Buffer search and replace.
string trim(string str,
 [string chars = " \\t\\r\\n"])
Chomp characters from a string.
int undo([int move],
[int pastwrite = -1],
[int redo = FALSE])
Undo previous edit operations.
int unregister_macro(int type,
 string macro,
 [int local = FALSE])
Remove a registered macro.
int up([int lines = 1])
Move position up one line.
string|int upper(string str|int character)
Convert string or character to uppercase.
int use_local_keyboard(int kbdid)
Associate a keyboard with a buffer.
int use_tab_char([int|string yesno],
[int global = FALSE])
Configure use of hard/soft tabs.
int version([int major | string machtype],
 [int min],
[int edit],
[int release],
[string machtype],
 [string compile],
[int cmversion],
 [string features],
[string build])
Version information.
int window_color([int color|string color],
[int winnum])
Set the window attribute.
int write_block([string filename],
 [int append = FALSE],
[int keep = FALSE],
 [int pause = TRUE])
Write selected region.