Setup Compiler in PSPAD


For Delphi Users, there is no problem as Delphi IDE itself is used for editing text an compiling them on the go. A free alternative woud be using either Lazarus or MSEIDE with the Freepascal Development tool. Lazarus itself is great, you will have all the features that you would have with the Delphi IDE and there are many more benefits one can gain with Lazarus.
Lazarus IDE
And there is the MSEIDE Development which like Lazarus can be configured to compile the file with Freepascal.

But, what if the user only needs a text editor ?
Well, there is the FP IDE itself too which can be used for editing pascal files and no doubt it is powerful and also gets installed by default with the Freepascal Development Tool. Many actually recommend the use of FP IDE itself because it is powerful.

The Freepascal IDE
But, what else could be used instead of the FP IDE itself?
PSPAD is a freeware universal text editor with support for multiple programming and scripting langauges. It currently supports: C/C++, COBOL, MS-DOS BATCH, VBSCRIPT, JAVASCRIPT, FORTRAN, HTML, XHTML, JAVA, KIXTART, OBJECT PASCAL, PERL, PHP, PYTHON, SQL, VISUAL BASIC, X86 ASSEMBLY, etc. It supports Code-Completion, Braces Matching, Syntax Highlighting, HEX-Editor, Spell Checker and countless other valuable features you will otherwise find only in a commercial text editor. It also allows the user to set compiler settings so that you can compile your file with your Desired Compiler, start Projects, desktop-session, etc.

Starting PSPAD
PSPAD Code Completion
Setting Pascal as your default Desired Filetype:

Settings -> Program Settings -> Files and Dirs

Goto Settings -> Program Settings -> Files and Dirs
Now, select Object Pascal under New Default
The result will be that whenever you open new file, it will have .pas extension. The Editor will use your Pascal Compiler (if the compiler has been setup) to compile your new file.

Configuring the Compiler:

Settings -> Highlighter Settings -> Object Pascal -> Compiler

Goto Settings -> Highlighter Settings -> Object Pascal -> Compiler
Under Compiler:
Type the fullpath of the fpc.exe file.
In my case, as you can see inthe Image, it is:  D:\Freepascal\bin\i386-win32\fpc.exe
In your case, D:\Freepascal would have to be replaced by your Freepascal installation directory path.
Under Parameters:
Type: %FILE% signifying that the file which the Editor should pass to the Compiler for Compilation is the fullpath of the file you are writing on the Editor.

Now, goto Files -> Compile or simply press Ctrl + F9 and the file wil be compiled.

Compiled Executable

Learn how you can make a driver in Freepascal.

Found this post useful ? If so, please Click +1 and RECOMMEND THIS SITE on Google

No comments:

Post a Comment