Some demonstrations of Windows XP programming using Free Pascal

Free pascal is an exellant pascal compiler developped under the GLP licence.
It works on many platforms, such as Linux and Windows.
The main page is : http://www.freepascal.org/

Using Free pascal, I developped commented examples, and the beginning of an object library. I will call this library the " GAP Library " or simply GAPLIB. "GAP" means Group of Applied Physics. I developped there a similar library using Borland OWL, with Borland Pascal 7.0 under windows 3.1. Here are versions you can download :
- Demo05  older version
- Demo06 older version
- Demo07 newer version, but some programs has not been tested and
due to some differences between FreePascal 2.2.0 and 2.4.0, problems may occure.
For example, sometimes the unit : "commDlg" has to be added to the "Uses" when using version 2.4.0. See the last examples.

  In Demo05, some mathematical units have been developped, and a program which plays at MineSweeper in tEx065.pp This last program was a kind of game for me and took my some weeks, and I was quite buzzy with other things, thus I didn't progress as I thought.

Six years elapses between the Demo05 and Demo06 versions.
I don't spend much time on this developpment, but if it can be usefull for somebody, here it is.

Four years elapses between the Demo06 and Demo07 versions.
Demo07 was developed with FreePascal version 2.4.0.

Some files are commented in french or in a mixture or french and english.
Now, in 2012, I use ConTEXT to developp the programs. Here are some informations to use it :
Here you can you download ConTEXT : http://www.contexteditor.org/fr/
Under "Options" ; "Environement Options...", select "Execute Keys", "Add" and type "pp"
Fill the "User exec keys" from ".pp" as follow :
F9 : usefull to compile the current file (and like it). ".exe" is put in directory "exe" and intermadiate in directory "obj".
  Execute : "C:\Program Files\FreePascal240\bin\i386-win32\fpc.exe"
  Start in : "%p"
  Parameters : "-FEexe -FUobj %f"
  Window : "Normal"
  Hint : let it empty
  Save : "Current file before execution"
  Use short DOS names : not checked
  Capture console output : checked
  Compiler output parser rule :"%F.pp(%l"
  Scroll console to the last line : not checked
  Idle priority : not checked
F10 : usefull to execute the program associated to the current file
  Execute : "C:\Apps\runit_RUN_ConTEXT.bat"  the file "runit_RUN_ConTEXT.bat" can be found in the "batch" directory.
                       The batch file should be changed to refere the correct directory
  Start in : "%p"
  Parameters : "%F.exe"
  Window : "Minimized"
  Hint : let it empty
  Save : "Nothing"
  Use short DOS names : not checked
  Capture console output : not checked
  Compiler output parser rule : empty
  Scroll console to the last line : not checked
  Idle priority : not checked
F11 : Not necessary, usefull to compile and execute the program associated to the current file
  Execute : "C:\Apps\runit_Compile_V2_ConTEXT.bat"  the file "runit_Compile_V2_ConTEXT.bat" can be found in the "batch" directory.
                        Then "analyse.pp" can be found in "TestAnalyseCompile" and has to be adapted and compiled.
  Start in : "%p"
  Parameters : "%f"
  Window : "Normal"
  Hint : let it empty
  Save : "Current file before execution"
  Use short DOS names : not checked
  Capture console output : checked
  Compiler output parser rule : empty
  Scroll console to the last line : not checked
  Idle priority : not checked
F12 : Not necessary, usefull to compile and execute the program associated to the current file
  Execute : "H:\Apps\runit_Compile_Run_ConTEXT.bat"  the file "runit_Compile_Run_ConTEXT.bat" can be found in the "batch" directory.
                        Then "analyse.pp" can be found in "TestAnalyseCompile" and has to be adapted and compiled.
  Start in : "%p"
  Parameters : "%F"
  Window : "Normal"
  Hint : let it empty
  Save : "Current file before execution"
  Use short DOS names : not checked
  Capture console output : checked
  Compiler output parser rule : empty
  Scroll console to the last line : not checked
  Idle priority : not checked

It is also possible to use the Crimson editor :
Here you can download it : http://www.crimsoneditor.com/
Under "Tools" ; "Preferences", select "User Tools"
"Compile, Ctrl+1"
  Menu Text : "Compile"
  Command : "C:\Program Files\FreePascal240\bin\i386-win32\fpc.exe"
  Argument : "-FEexe -FUobj $(FileName)"
  Initial Dir : "$(FileDir)"
  Hot Key : "None"
  Capture output : checked
  Use short filename (8.3) : not checked
  Save before execute : checked
"Compile Out in Results.txt", Ctrl+2 : Not necessary
  Menu Text : "Compile Out in Results.txt"
  Command : "C:\Apps\runit_Compile_Run_Crimson.bat"  the batch file should be changed to refere the correct directory
  Argument : "$(FileTitle)"
  Initial Dir : "$(FileDir)"
  Hot Key : "None"
  Capture output : checked
  Use short filename (8.3) : not checked
  Save before execute : checked
"Run", Ctrl+3 : to run the program associated to the current file
  Menu Text : "Run"
  Command : "C:\Apps\runit_RUN_ConTEXT.bat"
  Argument : "$(FileTitle)"
  Initial Dir : "$(FileDir)"
  Hot Key : "None"
  Close on exit : checked
  Capture output : not checked
  Use short filename (8.3) : not checked
  Save before execute : not checked

Another possibility is to use NotePad++ :
Here you can download it : http://notepad-plus-plus.org/
To use it well, you should add the plugin "NppExec" which allow you to execute some more commands.
Under "Complément" ; "NppExec" ; "Execute" (in the french version), add the folowing commands
"Save & compile & Run .pp"
  NPP_SAVE
  CMD /c c:\Apps\runit_Compile_Run_NotePadPP.bat $(CURRENT_DIRECTORY) $(NAME_PART)
"Execure.exe"
  npp_run $(CURRENT_DIRECTORY)\exe\$(NAME_PART).exe
"Save & compile .pp"
  NPP_SAVE NPP_EXEC h:\Apps\NotePadPP_Script_Compile.txt
"Save & compile v3 .pp"
  NPP_SAVE CMD /c "C:\Program Files\FreePascal240\bin\i386-win32\fpc.exe" -FE$(CURRENT_DIRECTORY)\exe   -FU$(CURRENT_DIRECTORY)\obj $(FULL_CURRENT_PATH) > c:\Temp\Results.txt NPP_EXEC   c:\Apps\NotePadPP_Script_Analse_H_drive.txt
"Save & compile v4 .pp"
NPP_SAVE
CMD /c c:\Apps\runit_Compile_NotePadPP.bat $(CURRENT_DIRECTORY) $(NAME_PART)

It worked, but I don't use it a lot, so probably you have to adapte some part...


I used DevPascal which is a basic but good Integrated Developpment Environment (IDE) under windows, to write and compile FreePascal programs.
You can downlad it at the URL : http://www.bloodshed.net/dev/pascal.html
The main page is : http://www.bloodshed.net/devpascal.htm

The text IDE from FreePascal didn't work with satifactions when I tried it. I had very quickly crashes. I don't know why ?

I plan to continue the developpement of commened examples and library. I would like to do the same under Linux KDE, but I have 10 years experience under windows, and no experience programming under Linux KDE or GNOME.

I tried a littre GTK, which seems very interresting, but doesn't use the facilities and security of object programming. Maybe an object library using GTK would be interresting. For more information about GTK, see http://www.gtk.org/

I began to see how WOL works, but it is not commented, and had big bugs in december 2001. Since that time, I didn't try it again, since I played developping my own library. After each execution of the version 0.7, I had to reboot my computer, because the resources of my computer went down to zero. I tried to see where the problem was, but found only another problem that resources are kept into memory. Thus using many different colors make the computer crash very quickly. For more information about WOL, see http://wolibrary.tripod.com I found it it a good project, but documentation fails, and memorising resources instead of releasing them, is not a good idea.

If you have problems with the .ZIP files, or simply want to use the bes file manager under window I know, dowload the shareware Windows Commander at the URL : http://www.ghisler.com
For me it replaces so many other utilities at the same time. A button launch bar, an FTP program, many decompacter such as unzip, a file comparaison program, a directory comparaison program, many files viewer (It you download IrfanView and use it with Window Commander addOns) and more. It even dedtected once a virus in a computer where I worked, simply by telling us that the executable file has been modified.

Why did I do that ?

For fun... and because I miss a lot Borland Pascal for windows. I dislike Delphi.


Back to my main page (in French)
Last update done the 18th of April 2012 by   Bernard Gisin.     ( Envoyer un e-mail )
Hosted by : www.Infomaniak.ch