3rd-Party Programs
========================================

This documentation is ment to show 3rd-party authors how to intergrate with
FLAG+, it does NOT teach you how to program.


1.0 General Information
========================================

FLAG+ does not have any open files after loading, so feel free to open on any
file channel. -Its still a good idea to use the FNext() and DNext() functions.

Do not use the esc[s ANSI sequence, since FLAG+ already saves the position
at the end of the prompt.  Also, FLAG+ uses the RIP save screen command; so
if your program is going to need to redraw the file screen don't use it, or
redraw the PREFILER.* file before ending the program.


1.1 Commands Passed from FLAG+
========================================

FLAG+ passes several commands (information) to the executing PPE, which may
be useful for the program.  This is done by use of the TOKENIZE statement,
meaning you'll need to use the GETTOKEN() statement/function to receive it.

Token #1:  Filename of selected file; if no files are selected, "<NULL>" will
           be returned.
Token #2:  Line number of selected file, zero if no files are selected.
Token #3:  Color of normal filenames (specified in configuration editor).
Token #4:  Color of selected filenames.
Token #5:  Color of flagged filenames.
Token #6:  Color of selected and flagged filenames.

Example 1:

BEGIN

  BYTE line
  STRING file,color(3)

  GETTOKEN file      ; set file variable to selected file, ie FILENAME.ZIP
  GETTOKEN line      ; set line variable to line number of file, ie 15
  GETTOKEN color(0)  ; set color(0) to the color of normal filenames, ie @X0E
  GETTOKEN color(1)
  GETTOKEN color(2)
  GETTOKEN color(3)

END


1.2 Commands to Pass Back to FLAG+
========================================

Sometimes you'll need to modify the flagged file queue, redraw the screen, and
even reprint the prompt line.  You may do this by passing keystrokes back to
FLAG+.

Parameters:  #1 (Redraw screen),  #2 (Reprint prompt),  #3 (modify queue)
Options:       0 = FALSE            0 = FALSE             0 = FALSE
               1 = TRUE             1 = TRUE              1 = FLAG
                                                          2 = UNFLAG
                                                          3 = TOGGLE STATUS
Heres a few examples:

KEYFLUSH  ; always clear the keyboard buffer first

KBDSTUFF "000"                       ; do nothing (default)
KBDSTUFF "100"                       ; redraw screen
KBDSTUFF "010"                       ; reprint prompt
KBDSTUFF "001FILE1.ZIP;"             ; flag 'file1.zip'
KBDSTUFF "001FILE1.ZIP,FILE2.ZIP;"   ; flag 'file1.zip' and file2.zip
KBDSTUFF "002FILE1.ZIP;"             ; unflag 'file1.zip'
KBDSTUFF "002FILE1.ZIP,FILE2.ZIP;"   ; unflag 'file1.zip' and file2.zip
KBDSTUFF "003FILE1.ZIP;"             ; toggle status of 'file1.zip'
KBDSTUFF "003FILE1.ZIP,FILE2.ZIP;"   ; toggle status of 'file1.zip' and
                                     ; 'file2.zip'
KBDSTUFF "012FILE1.ZIP,FILE2.ZIP;"   ; reprint prompt and unflag 'file1.zip'
                                     ; and file2.zip
KBDSTUFF "103FILE1.ZIP,FILE2.ZIP;"   ; redraw screen and toggle status of
                                     ; 'file1.zip' and file2.zip

Pretty simple, just remember when modifing to queue, use commas, ",", to
separate the filenames and semi-colons, ";", to end the string.  Also, make
sure its in UPPER CASE!

* SAMPLE SOURCE CODES * are included for all the 3rd-party programs included.


2.0 Questions and Answers
========================================

If you have any question regaurding 3rd-party add-ons, etc, please leave a
message on my board to Paul Miller (SysOp of Reality's Edge (517)349-0538).


3.0 Ideas!
========================================

Any ideas for FLAG+, please leave a message on my board to Paul Miller (SysOp
of Reality's Edge (517)349-0538).