Hey all,
I'm new to Pascal and Lazarus, and having a great time learning. I got a wild hair recently to compile the Jedi Code Formatter as a standalone utility for Linux (yes, I know it's built in to Lazarus, but I'm attempting a
learning experience). I thought since there was a Lazarus project for it, it shouldn't be too hard. As you can imagine, I've run into a few hangups.
I downloaded the JCF code from the SourceForge site and the first time I attempted to compile, I got:
JCF.lpr(3,2) Warning: APPTYPE is not supported by the target OS
JCF.lpr(1,1) Fatal: Unit FileUtils searched but FileUtil found
Well, Utils/FileUtils.pas doesn't exist, so I commented out the 'FileUtils' uses line in JCF.lpr (couldn't hurt to try, right?), and it compiled successfully (yay!).
After that, I played with my shiny new executable and it works well, but I tired of the need to pass the settings file path in the options every time (which I found at /usr/lib/lazarus/1.0.10/components/jcf2/JCFSettings.cfg). Sure, I could just put the command in a shell script, but it seems to me there might be a way to pass the path to the config file automagically the way the current Windows code gets it from the Registry. I've worked up some test code with
GetAppConfigFile and
OnGetApplicationName that works to return a path to the configuration file ($HOME/.config/jcf/JCFSettings.cfg ought to work fine), but only in my test code; I'm rather unclear where to stick it in the project. Maybe in the registry read code with the appropriate {ifdef}?
After I get that tackled, I'd like to port the GUI to Lazarus/Linux as well, but first things first.
Any help with this wild goose chase will be appreciated; jeering and mockery will be cheerfully returned, minus tax.
