Interface vs Batch mode lazarus / 39-Graphics ---------------------------------------------------------------------- manfred · 2011-01-14 11:01 Hello, I'm a new user of Lazarus and a real Pascal illiterate. I have a Delphi program that compiles perfectly with Lazarus. However I would like to run it in batch mode. Is it possible to get completely rid of the interface? I removed the code for the interface as it only serves to create files that will be used by the program but a small empty window remains. Can we basically avoid opening any form? Many thanks, Manfred ---------------------------------------------------------------------- Leledumbo · 2011-01-14 11:10 Sure. But you should change the lpr file. Remove Application.* and change with the actual program code. Remove Interfaces and Forms unit (if you don't use it) from uses clause. Ensure used units has no forms. Remove (< 0.9.28.2): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i initialization  {$I formunit.lrs} Or (>= 0.9.29): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$R *.lfm} from the unit which has form. ---------------------------------------------------------------------- manfred · 2011-01-14 17:00 Thank you leledumbo for you prompt answer. In the main unit I have the following line: PathNameProg := application.exename; What should I write instead? ---------------------------------------------------------------------- Leledumbo · 2011-01-14 17:35 Try ExtractFileName(ParamStr(0)). ---------------------------------------------------------------------- manfred · 2011-01-17 16:49 I compile and link the project properly (apparently) but when I run the executable I obtain the following error message (I work under windows): [FORMS.PP] ExceptionOccurred   Sender=EAccessViolation   Exception=Access violation   Stack trace:   $004E4911  TCUSTOMFILELISTBOX__SETDIRECTORY,  line 389 of filectrl.pp   $00402CCF  HANDLEPROJECTLIST,  line 90 of ACsaV31plus.lpr   $004031D5  main,  line 176 of ACsaV31plus.lpr TApplication.HandleException Access violation   Stack trace:   $004E4911  TCUSTOMFILELISTBOX__SETDIRECTORY,  line 389 of filectrl.pp   $00402CCF  HANDLEPROJECTLIST,  line 90 of ACsaV31plus.lpr   $004031D5  main,  line 176 of ACsaV31plus.lpr exception at 004E4911: Access violation. In fact in my first unit I have the lines Code: [Select]type   TStartForm = class(TForm)     TheFileListBox : TFileListBox;     procedure FormActivate(Sender: TObject);   private     { Private declarations }   public     { Public declarations }   end; var   StartForm: TStartForm;  I commented this paragraph and ran the "FormActivate" outside the procedure markups but I have a problem with the TFileListBox. Can I replace it with something else? Thanks! ---------------------------------------------------------------------- Leledumbo · 2011-01-17 18:07 Err... I'm confused now. Do you still want that GUI or convert it to console mode? TFileListBox is a visual component. ---------------------------------------------------------------------- manfred · 2011-01-18 08:27 I want to get rid of all graphical interface. As the initial form was using this TFileListBox, I was wondering whether this could be the cause of the error and looking for a substitute. Thanks! ---------------------------------------------------------------------- Leledumbo · 2011-01-18 11:21 If so, then you have to get rid TFileListBox as well. Even more, no StartForm, no FormActivate, no event-driven code! Remove them all and move logic code (that deals with data storage and manipulation) to somewhere else (if it's located inside an event or form's method). ---------------------------------------------------------------------- manfred · 2011-01-18 13:59 Sounds like a lot of fun Do you know a non-graphical substitute for TFileListBox? Thanks! ---------------------------------------------------------------------- Leledumbo · 2011-01-18 18:09 QuoteDo you know a non-graphical substitute for TFileListBox?Not really, but I bet it's some kind of TStrings descendant.