© Copyright Clive E. Chapman 2008. All rights reserved. |
This page | Other pages |
---|---|
Overview | Main Page |
Invocation | Licence |
Profile | FL User Guide |
Usage Notes | FLCUST User Guide |
Sample Profile | FLFIND User Guide |
FLTREE User Guide | |
TEE User Guide |
In FL it is useful to have a function key that can edit or view files of any type. For this to be possible, FL must invoke the tool or program that is appropriate for the file extension, but FL itself does not have this knowledge. FLVIEW is a user-customisable program that addresses this problem. When you want to edit or view a particular file, you invoke FLVIEW, and FLVIEW then invokes the program that is appropriate for the file extension.
FLVIEW uses a profile to define the associations between file extensions and the programs that edit or view files with those extensions. The default name of the profile is "FLVIEW.PRO", and its default location is the directory in which FLVIEW.EXE resides. A sample profile is provided for each supported operating system, but you will need to modify these to suit your own requirements.
FLVIEW [fv_opts] filespec [cmd_opts]
where square brackets [ ] denote optional items. Parameters and options are as follows:
/p:.\new
If the extension and its preceding dot are omitted, "pro" is used for the file extension. To read a profile that has no file extension, end the name with a dot. Example:
/p:all.
If the profile filespec contains blanks, the entire option (including the option name) must be enclosed in double quotes. Example:
"/p:C:\Documents and Settings\Me\My FLVIEW.Pro"
The selector value is a string of one or more characters, and is not case sensitive. The special value "*" can be used to indicate that any profile selector value is acceptable (so the definition used is the first one for that file extension in the profile). If the /S option is not specified, "/S:*" is assumed.
This option can be used to choose a different definition in different situations. For example, you might use one program for browsing a file, and a different program for editing it. You can choose between these two by using a different selector for each – you might use "/S:BROWSE" for the browse program, and "/S:EDIT" for the edit program. In FL you would use two different function keys, one for browse and the other for edit; they might have these key definitions:
Key | Definition |
---|---|
F1 | FLVIEW /S:BROWSE # |
F2 | FLVIEW /S:EDIT # |
In these examples, "#" is the command prefix character. If you want to use "/" as your command prefix character, remember to double-up the "/" used for the option ("//S:EDIT"); alternatively, use the "-" option prefix character ("-S:EDIT").
FLVIEW requires a profile to define the association between a file extension and the program used to edit or view files with that extension. Use the following guidelines to create your profile:
If "*" is specified for the extension in the profile, it matches ALL file extensions, including those with null extensions (""). If you want a definition that matches all files other than those with null extensions, specify "?*" for the extension in the profile.
If "*" is specified for the selector in the profile, it matches ALL selectors specified on the FLVIEW invocation.
"c:\program files\internet explorer\iexplore.exe"
A substitution code consists of the left square bracket, followed immediately by a single character in upper or lower case, followed in turn by the right square bracket. The following substitution codes are valid:
Subst code | Replaced by | Example |
---|---|---|
[d] | Drive | E: |
[e] | Extension (no dot) | jpg |
[f] | File ("name.ext") | sunflower.jpg |
[n] | Name | sunflower |
[p] | Path | \photos\ |
[w] | Whole filespec | E:\photos\sunflower.jpg |
The entire three-character substitution code is replaced by the appropriate part of the filespec specified on the invocation of FLVIEW. Note that if parts of the filespec are missing on the invocation of FLVIEW (for example, the drive and path), the values substituted will be the null string for those omitted parts.
FLVIEW does not scan the strings substituted, so if the filespec itself happens to contain a valid substitution code, it is passed unaltered to the program invoked.
See below for a sample profile.
!#r #\*.* #|| flview.exe #
This definition behaves as follows: if the line where the command is entered is a directory, that directory is made the current directory and its contents are displayed. If the line is a file, FLVIEW is invoked to invoke in turn the program appropriate for the file extension of the file.
Note: in this example, the exclamation character "!" at the start of the command is FL's line prefix character that suppresses echo of the command on the screen (useful for full-screen applications).
The FL way to do this is to use two different F-keys – a "View" F-key and an "Edit" F-key. You use FLVIEW with both keys, but use a different selector for each; the selector causes FLVIEW to use the appropriate definition from the profile. For example, you might use "/S:V" for the view program, and "/S:E" for the edit program.
A sample profile is shown below. Note that for display on this page, long definitions have been split over two lines (indicated by the ellipsis "..."). However, in the profile itself each definition must be contained entirely on one line.
!************************************************************ ! Sample FLVIEW profile for: ! Windows 95/98/98SE/ME/NT/2000/XP/Vista ! ! Blank lines and lines beginning with "!" char are ignored. ! Use subst codes to indicate where filespec should appear: ! [d] drive ("d:") [n] name ! [p] path ("\path\") [e] ext (no dot) ! [f] file ("name.ext") [w] whole filespec ! Wildcard chars are valid in Extension and Selector cols. !************************************************************ ! Ext Sel Command ! --- --- ------------------------------------------------- avi * "c:\program files\videolan\vlc\vlc.exe" "[w]" htm BRW "c:\program files\internet explorer\... ...iexplore.exe" "[w]" htm EDT "c:\windows\notepad.exe" "[w]" jpg BRW "rundll32.exe" c:\windows\system32\... ...shimgvw.dll,imageview_fullscreen [w] jpg EDT "c:\program files\adobe\photoshop elements 2\... ...photoshopelements.exe" "[w]" pdf * "c:\program files\adobe\acrobat 7.0\reader\... ...acrord32.exe" "[w]" rtf * "c:\program files\windows nt\accessories\... ...wordpad.exe" "[w]" wma * "c:\program files\windows media player\... ...wmplayer.exe" "[w]" "" * "c:\windows\notepad.exe" "[w]" * * "c:\windows\notepad.exe" "[w]" ! --- --- ------------------------------------------------- ! Ext Sel Command
In the sample profile shown above, separate browse and edit functions are defined for files with extensions of HTM and JPG, so the definitions for those extensions have specific selector values ("BRW" and "EDT"). For the other file extensions, the same program is used for both browse and edit, so they use a selector of "*".
Page last changed: 2008-07-25 |