Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build Project as GUI or Console

Status
Not open for further replies.

topcat01

Programmer
Jul 10, 2003
83
GB
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.

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;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top