Contents of Article


The DEFAULT Profile

What settings are maintained in each Profile ?

Automatic Colorization linkage

Managing changes to a Profile

Profile display

Profile locking

Extended File Types

Copying Profile settings



Introduction


There are many different settings and customization options that can be chosen when editing a file, such as whether to use Tab columns and where they are located, Auto Backup and Auto Save options, Caps mode, the definition of WORD characters, etc. With the different types of files you may edit, you will often need different settings for each file type.


Source files used in programming languages usually use different tab settings, colorization options, and delimiters. Text data files likewise often have differing requirements.


SPFLite provides the ability to create multiple Profiles, each with different settings to handle various file types. The EFT (Extended File Types) support allows you to flexibly associate the different file types to the Profile best suited for them.  This can be as simple as a one-for-one match of file extension to Profile name, or a more complex filtering based on the files location, name, format etc.  Review Extended File Types for a full description of these capabilities.


Profile information is stored in the SPFLite CFG file, each Profile is stored independently. 


The DEFAULT Profile


There are a wide variety of file types, which are still basically just common text files. (e.g. BAT, INI, CSV etc.)  You can certainly have separate Profiles for each of these files, but after a while, you may find you have dozens of profiles, most of them having exactly the same set of options chosen. This not only creates "Profile Clutter", but if you decide to alter one or two Profile options, you are then faced with making that change to a large number of Profiles.


Enter the DEFAULT profile.


The reserved profile name DEFAULT has the following characteristics:


    • It is so important that it is checked for at the beginning of every SPFLite run, and if it does not exist you will be prompted to immediately create one before SPFLite will proceed.


    • When an edit of a previously unreferenced file type is requested, and SPFLite cannot select an appropriate Profile file, it displays the following popup message:


Note: If the command (EDIT, CREATE etc.) that triggered the detection of the missing Profile was issued by a macro, the popup will not appear. A NEW profile will automatically be created using the actual running set of Profile variables. 



Here you can choose one of the following ways to handle this missing Profile:


DEFAULT

Add this file extension (in this example TXTMNO1) to the list of extensions in the EFT table which will automatically use the DEFAULT Profile


Create XXX Profile

Create a new, unique Profile for this filetype.  The initial settings for the profile will be copied from whichever existing Profile you choose (Note: DEFAULT is established as a starting point.  You can alter any of these settings either from within the Edit session which will be started, or later via a PROF EDIT XXX command to open the Profile Editor.


(Choose) Pulldown List

Set this file type to actually use an existing Profile.  This will be done via the EFT (Extended Filetype Table) e.g. an entry will be made in the EFT table to cause the chosen Profile to be used for this filetype. For example you might want a filetype of .H to use the same Profile as .CPP


Cancel

Cancel the opening of this file


Mark as NONTEXT

Cancel the open of this file, and add an entry to the EFT table indicating this is a NONTEXT type file. This will cause File Manager to ignore these files in the future.


Mark as OPENWITH

Cancel the open of this file, and add an entry to the EFT table indicating this is a NONTEXT,OPENWITH WINDOWS type of file. This will cause File Manager to open the file with whatever default application it is associated with in Windows.




The DEFAULT profile is also used as the profile for the File Manager tab itself. Since the File Manager tab is not used for editing, what purpose does it serve there?   It is used for the Find in Files command FF. Since this is essentially a FIND command, the Find in Files searches will use the DEFAULT setting for the CASE profile option from the DEFAULT profile. (The CASE setting and the FIND WORDS/CHARS option can be temporarily changed by issuing this commands on the File Manager primary command line.


What settings are maintained in each Profile ?


The following settings are kept uniquely for each different Profile:


ACTION

Specify automatic SAVE

AUTOBKUP

Whether to create a backup file.

AUTOCAPS

Whether to use AUTOCAPS support or not.

AUTONAME

Specify an alternate AUTO file name

AUTOSAVE

Whether to automatically save a file at END processing time.

BOM

Set BOM writing ON / OFF

BNDS

The left/right column boundaries for the file.

CAPS

Whether CAPS is to be forced on or not.

CASE

Default case handling for FIND/CHANGE literals.

CHANGE

Whether string changes are handled in Data Shift (DS) or Column Shift (CS) mode.

COLS

Whether to display a fixed COLS line at top of screen.

COLLATE

The code page used for the character set collating sequence

DCB

Specifes the three Settings RECFM, LRECL and EOL together.

EMACRO

The name of a Macro to be invoked immediately prior to a File Save operation.

EOL

Specifies the End-Of-Line delimiters. Deprecated - Use DCB.

FOLD

Whether lower-case letters are displayed as if upper-case

HEX

Whether HEX editing mode should be used as a default for the file type.

HILITE

Whether to use automatic colorization support, and FIND / CHANGE highlighting.

IMACRO

The name of a Macro to be invoked immediately following the loading of the file

LRECL

The record length of the file. 0 = unspecified. Deprecated - Use DCB.

MARK

The current column MARK settings.

MASK

The current model MASK line

MINLEN

The minimum logical record length

MODE

Set and switch a tabs Edit mode

PAGE

Whether to use PAGE mode for FORMAT End-of-Line AUTO or  AUTONL files

PRESERVE

Whether to retain trailing blanks on text lines or not.

RECFM

The record format of the file. e.g. Fixed, Variable, Undefined. Deprecated - Use DCB.

SCROLL

The default scroll amount for UP / DOWN / LEFT / RIGHT commands.

SOURCE

The data encoding used by the data (ANSI, UTF8, EBCDIC, etc.)

START

The default positioning of a file when opened.

STATE

Whether persistent STATE information is retained for this file type

SUBARG

The unique SUBARG value for use during SUBMIT processing.

SUBCMD

The SUBCMD value for use during SUBMIT processing.

TABS

The TABS On/Off setting; the ==TABS> line value specifies the actual Tab locations.

WORD

The current set of valid WORD characters.

XTABS

The default tab spacing if loading files with embedded Tab characters.


Each of the above settings can be altered in either of two ways:


    • Directly with a primary command. The command name in each case is the same as the name in the left column above. (There is no SCROLL command, though. To change the default scroll amount, just type into the SCROLL field on the edit screen.)


    • By using a pop-up dialog reached by using the PROFILE EDIT xxx command, where xxx is the desired profile name to be altered.


Note: The BNDS, WORD, MARK, MASK and TABS line values are modified by altering the model line that are displayed. These model lines appear when you issue a PROFILE primary command, or on demand by using the BNDS, WORD, MARK, MASK and TABS line commands.


Using The Profile Edit Dialog


The Profile Edit Dialog provides a simple interface to allow altering multiple Profile setting as one time.   The command PROF EDIT profname

will open a new pop-up dialog that allows you to modify nearly all Profile variables in one location.


The dialog which opens has two tabs to provide all the options available.


The first tab (Profile Editor Options): 



The second tab (Profile File Data Options)


The instructions for each of these settings was provided previously HERE.  Refer to that section for links to all the various settings.



Automatic Colorization linkage


If you utilize Automatic Colorization Files, the name of the colorization control file is normally equal to the name of the Profile being used. The AUTONAME command can be used to alter this default to any other desired AUTO file


Managing changes to a Profile


Profiles values can be critical to proper edit processing and it is prudent to protect these settings from being altered inadvertently. Here are some tools to assist you:


Profile display


It is often necessary to display the current Profile. This can be done while editing a file of the type involved, by entering the PROFILE command (without any extra operands) and pressing Enter. SPFLite will insert a series of lines into the display as follows:



This display shows you the current values for all profile settings.


If the running edit session was invoked using an EFT Override, the display will alter to show the EFT statement used and to hilite the individual values by surrounding them with <...> brackets. 



Profile locking


If you look at the first =PROF> line in the 1st example above, you will notice the word UNLOCKED. This means that any changes you make to profile values will be automatically saved. If the value had shown as LOCKED, then no changes to the Profile would be saved while the Profile is LOCKED. Any of the displayed values can be altered for the duration of this edit session using the various profile-modifying commands, but the changes would not be permanently stored.


A profile can be locked once you have a set of values you wish to keep by issuing the PROFILE LOCK command. Similarly, if you want to alter one of a locked Profile's settings permanently, you must issue a PROFILE UNLOCK command first, make your change, and then issue a PROFILE LOCK command to retain the lock going forward.


Note that if the profile is LOCKED, the lock prevents it from being permanently altered. The lock does not prevent its settings from being temporarily altered during the course of an edit session. Those alterations simply won't be saved.


The keywords LOCKED and UNLOCKED can also be spelled as LOCK and UNLOCK.


The 2nd example shows EFT LOCKED. This indicates that regardless of the Profile's normal LOCK status, the Profile has been locked since it was temporarily modified by the EFT override support. This is to prevent these temporary overrides being saved back to the normal Profile values.



Extended File Types


You may typically need to work with different file types that all have a common format. For example a programming language may use different file types for main programs, header files, include files, macro files etc. but may all be of the same format and must be treated the same.


Since SPFLite would ordinarily treat all these different file types as independent Profiles, it would make changing a given profile option a problem, because the change would have to be made to each of the different file profiles. This is a time-consuming and error-prone process.


SPFLite provides a tool that allows you to specify that these fle should all use a common Profile. This support is referred to as Extended File Types. It basically allows you to point a specific filetype to any existing Profile. So how does that help?


Say we have a source language like C (.C) which also has associated header files (.H). All that needs to happen is to create and customize the C Profile as you desire. We can refer to this profile as the 'master' profile. Then, edit the EFT table (accessed by entering an EFT command), and add an entry that says .H = C 


Now, whenever you edit a .H filetype, it will use the .C Profile


You can of course point multiple filetypes to the same common Profile, there is no limit to the number.


The Opposite Need


There is also a sort of reverse requirement when it comes to assigning a Profile to a filetype. Many times you may have multiple files, of widely varying usages, and all end in the same filetype. A good example of this is .TXT.  Many files end in .TXT but actually require significantly different Profiles.


For example, some .TXT files may come from external locations and may need FORMAT End-of-Line = LF instead of CRLF. Or may need different SOURCE values (ANSI / EBCDIC) etc.


But they all end in .TXT !   What to do?


EFT provides extensive masking abilities to allow you to distinguish the variety of filetypes based on other parts of the filename, the folder or drive location. And then to specify another Profile and optionally override 1 or more individual options.


A simple form might be that files needing FORMAT End-of-Line = LF might always be named with a filename ending in LF, and the following two EFT statements would handle it:

\*LF.TXT = TXT,EOL LF

\*.TXT   = TXT

In this manner we can handle two unique circumstances with only one Profile.


Refer to "Working With Extended Filetypes" for full details of EFT support, examples of syntax and further practical examples.



 

Copying Profile settings


If you find yourself editing a file type for the first time, you may realize that a number of settings that must be customized for this new type are just like another file type which you have already defined. You can quickly copy all the settings from another profile with the PROFILE COPY xxxx command. The other profile's settings will replace the one in the current profile. A PROFILE COPY operation is a one-time event. 


When you COPY another profile, the settings of the two profiles are completely independent of each other; a subsequent modification of one of the profiles has no effect on the other profile.


Profiles and the FF (Find in Files) Command


The FF (Find in Files) command in File Manager will search all displayed filenames for your requested string. Since SPFLite supports a wide variety of file data formats (ASCII, EBCDIC, etc.), the FF command requires a File Profile to exist for all the files it is searching so that it can properly read the data for the search.


However, a displayed list of files may contain other file formats which are never edited by SPFLite. If you are aware of these ahead of time, you can specify specific file types for exemption by the FF command. (See Extended File Types)


Many times though, files slip through this process and trigger a pop-up during the FF search when it encounters an unknown file type. You will see the following displayed:




This example was triggered by a .TXTMNO file type. At this point you can choose one of the 6 options.


    • Use the DEFAULT profile for this and any other .TXTMNO  files seen subsequently.
    • Create a new TXTMNO  profile for this file type. It will be based on the DEFAULT profile.
    • Select another existing Profile to be used for .TXTMNO files.
    • Abort the FF search at this point.
    • Skip this .TXTMNO file, and add it to the EFT NONTEXT list for future searches.
    • Skip this .TXTMNO file, and add it to the EFT NONTEXT,OPENWITH WINDOWS list for future searches.


Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced Customization Options