File SELect and eXecute

This is an add-on to (or a wrapper for) FSEL, the FILE_SELECT$ wrapper
program. It uses FSEL to select a file and then executes that file, whether
it be a "data" file or a program, using FileInfo2.


FSEL-X is for SMSQ/E only. The following additional "systems toolkits" are
also required: Qlib_run or equivalent, JMS'es Qmenu, and W Lenerz/T Godefroy's
FileInfo2. To run the SBASIC a bespoke toolkit, FSELX_bin, built from my
pick'n'mix toolkit collection at Knoware.no, must be pre-loaded. The
latter is built in to the compiled code. Oh yes, and did I mention that
FSEL, my FILE_SELECT$ wrapper program, V0.10 or later, must be available?
If you dont have it yet, get it from where you got this program.


This program only makes sense if you have a well-configured FileInfo2
system. It works quickest if FSEL is already loaded as a Thing (see the
FSEL manual, if need be).

The program reads a configuration file at startup. It needs to know where
to find it. The directory name can be inserted into the program with
(Menu)Config, if you want, or be specified on the program's command line.

This is how FSEL-X decides where to get its configuration file
directory / path:

1. If a directory is given on the command line, use that. Done! Eg:

        PRINT FEW("<path>FSELX_obj"; "<config path>")

2. If no directory is given on the command line then FSEL-X takes the
   configured directory name (if any).

3. If neither of the above has provided a directory, the Home Directory
   is taken.

If still no directory is found, or the name found doesnt lead to the
FSELX_cfg file, an error message is produced and the program terminates.

If you decide to put FSEL-X on a Hotkey - the recomended way of operating
it - then only methods 1 and 2 are possible, as Hotkeys (apart from HOT_LOAD)
cant handle Home Directories. (There are ways.. See the Home Thing manual.)

So with the program configured to find its config file in <path> you
could add something like the following line in your boot file:

        ERT HOT_CHP1("<key>", "<path>FSELX_obj", "FSEL-X")

If you havent configured a path, or want to use differents config files
(for example on another button) you could do something like:

   ERT HOT_CHP1("<key>", "<path>FSELX_obj"; "<config path>", "FSEL-X")

After that, if you wanted, you could put FSEL-X in a button in the Button
Frame, like this:

        BT_WAKE 'FSEL-X', ,,,2


FSEL-X relies on a simple configuration file for its user-preference
settings. This is located in the directory described above. The file is a
plain text file called - you guessed it! FSELX_cfg.

Note that the actual file cannot contain remarks! only the bits below the
--- and to the left of the |-bar.

/|        Setting          |                 Remarks                | Dflts
-- -----------------------   -------------------------------------- --------

/N FSEL                    | FSEL Thing name                        [  FSEL]
/F win1_util_file_Fsel_obj | Full FSEL filename                     [      ]
/X                         | x-origen of applet in absolute pixels  [      ]
/Y                         | y-origen of applet in absolute pixels  [      ]
/W                         | width in absolute pixels  (approx)     [      ]
/H                         | height in absolute pixels (approx)     [      ]
/T Some Title              | title string                           [FSEL-X]
/D win1_MyFiles_           | name of directory                      [PROGD$]
/E _txt                    | file name extension                    [      ]
/P2                        | palette: System 0..3                   [     0]

Keys must always be present and in the order they appear here.

Strings must not be quoted.

Hopefully the values to enter here are self-evident. No serious checking is
done on them, so you could crash the program, or menus could pop up in
inappropriate places. Simply re-think, adjust, and try again!

Some pointers:

If FSEL (not FSEL-X) is loaded as a Thing the /F parameter is ignored.

If a key is left blank FSEL's default values apply, so check the FSEL
  manual if you want to know what these are.

If you set a directory at /D then that directory is always used, otherwise
  it "floats", ie always uses the last directory chosen. If you set a
  directory here, remember the trailing underscore!

Ditto for the extension: If left blank the last extension used will appear
  next time, otherwise the extension you set will always be used. (Remember
  the leading delimeter, either _ or .).


In unforseen circumstances it could happen that FSEL-X's memory gets in a
muddle, ie it gets its directory wrong, or the extension in FSEL becomes
uneditable: Just type

        DELETE "history_fsel-x"

in an SBASIC consol and try again.

Program status

V0.01, pjw, 2021 Dec 19

Conditions and DISCLAIMER as per Knoware.no