Hi,
I have an existing GUI application and I want to be able to build existing code as a command line application using compiler directives. I think I know (untested) how to segregate main code as show below from a previous post on this list. However what code do I need to enter in the 'program' unit of the project? I do not know the proper name for it but it is the code which determines the type of program if that makes sense, depending on the build will determine if to create a GUI or console exe.
I have an existing GUI application and I want to be able to build existing code as a command line application using compiler directives. I think I know (untested) how to segregate main code as show below from a previous post on this list. However what code do I need to enter in the 'program' unit of the project? I do not know the proper name for it but it is the code which determines the type of program if that makes sense, depending on the build will determine if to create a GUI or console exe.
Code:
* taken from
procedure TQbExport2MySqlForm.UpdateStatus(Pan: integer; s: string);
begin
{$IfDef CONSOLE}
if pan = 0 then write(s + #32) else writeln(s);
{$ELSE}
StatusBar1.Panels[Pan].Text:= s;
{$ENDIF}
end;