The Clarion Advisor: Redirection Files

by Patrick O'Brien

Published 1999-09-14    Printer-friendly version

I recently settled on a redirection file strategy that I rather like, so I thought I would share it here, for anyone who might find it useful.

Clarion uses redirection files for two reasons: to search for files when a path has not been specified, and to decide where to put any files it creates. The default redirection file (i.e., CLARION5.RED) is in your Clarion \BIN directory, but you can place a copy of the redirection file in your application's directory, if you want to make changes that affect only that application.

It took me a while to understand that all you really need in Clarion is an .APP file and a .DCT file. All the other files in your project get generated for you and can be deleted once in a while to clean things up or, on occasion, to solve problems. So it makes sense to separate these files into their own folder. At first I figured out what the file extensions were and started adding a line in the redirection file for each type of file that I wanted to separate, like the following:

[Common]
*.inc = .\src
*.clw = .\src
*.map = .\src
*.shp = .\src
...

This had the effect of creating an \SRC folder below the folder in which my .APP and .DCT files were stored. (Clarion creates this folder automatically, if it doesn't already exist.) Into this folder Clarion generated the files with the extensions listed. But Clarion generates a wide variety of files, and this was getting out of hand. I reached my limit trying to get the shortcut to the .EXE to go into a separate folder.

Then I decided to change my strategy a little. Now, instead of saying what to put where, I tell Clarion to put everything in \SRC, except what I don't want to go there. How do I do that? Well, here is what my Common section looks like now:

[Common]
*.exe = .
*.dll = .;%ROOT%\bin
*.tp? = %ROOT%\template
*.trf = %ROOT%\template
*.txs = %ROOT%\template
*.stt = %ROOT%\template
*.*   = .\src; .; %ROOT%\examples; %ROOT%\libsrc; %cr.gif (846 bytes)
       ROOT%\images; %ROOT%\template; %ROOT%\convsrc
*.lib = %ROOT%\lib
*.obj = %ROOT%\lib
*.res = %ROOT%\lib

Only two little differences exist between my version here and the default that is shipped with Clarion. The first change I made was to the *.* line. The original version listed the first directory as just a dot. This meant that all files created by Clarion would be put in the same directory as the .APP file. (Remember that only the first directory listed specifies where files created by the application generator should go.) I added .\SRC to the front of the line, which means, "Put everything in a directory called 'SRC' just below the current directory, and create this directory if it doesn't exist."

The other difference is the one exception I made. I wanted the final .EXE to remain in the same directory as the .APP file, so I added the line:

*.exe = .

If you wanted to keep the ship list file there as well, you could add the line:

*.shp = .

And so forth. Now all the files that Clarion generates go where I want them to go. And, if I start running into weird bugs, I can delete everything in \SRC and recompile. If I want to see the actual code that Clarion generates, perhaps in a different editor, all the .CLW and .INC files are in the \SRC folder. Try it. You might like it.

 


Patrick O’Brien is a partner with Orbtech, where he occasionally dabbles in
software development using Wizatrons and Internet technology.

Printer-friendly version

Reader Comments

Posted on Saturday, December 16, 2006 by Edvard Korsbfk

Thar really cleaned my development folder.
Thanks!

Edvard Korsbý

To add a comment to this article you must log in.

 
 

Search

 

Advanced Search
Topical Index

Related Articles

Subscribe to
ClarionMag

One year: $189

(includes all back issues since '99)

Renewals from $139

Two years: $289

Renewals from $239

More Info

Subscribe Now!

ClarionMag Blog

RSS Feeds

Updates via Email

Enter your Email


Powered by FeedBlitz

Quick Links