The Editor Extension Commands

There are approx. 130 special editor extension commands and functions to manipulate the IDE and source code. These commands begin with the prefix 'Gfa_' and have no effect in a normal program. They are syntactically recognized but behave like dummy commands. A project is marked as an editor extension when it contains at least one event Sub that starts with Gfa_Ex_, Gfa_App, or Gfa_Run, etc. The following sample shows a typical editor extension subroutine; the subroutine heading defines the keyboard shortcut that invokes this routine: Gfa_App_2 meanming the keyboard combination application key + 2 executes the Sub, as it starts with 'Gfa_'. The heading is not case sensitive.

Example: Switch quickly between two files

 

Sub Gfa_App_2   ' load MRU file #2

If Gfa_Dirty Then Gfa_Save

Gfa_LoadMRU 2

EndSub

The example is actually very useful, because it allows you to switch between the current project and the second project very quickly. First, the dirty status of the current project is checked and it is saved when the project has been changed. Then the second file from the most recently used (MRU) files list is loaded into the editor, making itself number one in the MRU list. The project that has been removed has now become number 2. Pressing App + 2 now will save the current project if dirty and reload the one just removed and has become #2.

If you've not created an extension before, you could copy the code above into a new project and then compile and install it.

{Created by Sjouke Hamstra; Last updated: 15/07/2022 by James Gaite; Other Contributors: Jean-Marie Melanson}