INCLUDE.EX

(programming aid)

 

Over time you find that you accumulate a lot of header (include) files. If you are like me, you will have written many of these yourself. Some you use over and over again, others maybe not so often. It is convenient to keep all your header (include) files in one place, and I keep mine in the c:\euphoria\include folder along with the "official" header files that come with the language. To avoid accidents, I give all my header files names beginning with F (for Fred). As examples, I have a header file called fgraphic.e and another called fmenu.e. That way it is unlikely that any of my header files will have names that conflict with other header files.

 

When you are first learning euphoria you probably find yourself using guru a lot. A little later, when you have most of the core language commands down pat, guru is not needed so much. If you’re like me, the things you keep forgetting are the names of the routines you have put in your header files, along with the parameter lists used to invoke them and the format of any data  that the routine, if a function, returns.

 

INCLUDE.EX is a DOS utility that asks you for a word or phrase that might occur in the header line of the routine that you can't remember full details of. It then builds an internal list of the names of all the .e files in the c:\euphoria\include folder. Using that list it then seeks out all routines in those files that start with the words global function or global procedure. If your word/phrase is found in the name of any such a routine, the name line of that routine is added to a new list, along with the name of the header file in which that routine occurs. When this searcing is completed, the program presents the matching command-lines found (if any) to you as a numbered list on the screen.

 

Pick the one about which you want to see more information, and the program will present to you (1) the name of the header file in which the routine is located and (2) a listing  of the starting lines of the routine, including comment lines (as much as the screen will hold). The better you annotate your header files when you write them, the more useful this utility will be.

 

To use include.ex just put it in the folder that ed.ex treats as home (usually the bin folder) along with the file include.bat. Whenever you want help about a partially remembered header file routine, just press the escape key to get onto Ed's command line and then type d include and INCLUDE will fire up and prompt you the rest of the way. Alternatively you can bind the include.ex file and use the resulting include.exe file directly (in this case get rid of the include.bat file). If you don't like the name include you can give the file a different name.

 

Fred Mangan, 23 October 2006

 

----ooOooo----