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