Mega Code Archive

 
Categories / Delphi / Forms
 

Create application without forms

Title: Create application without forms Delete all forms from your project by using Project Manager and write your code in a project source file (DPR-file). This example creates a file with name like specified parameter and $$$.txt file if parameter is missed. program Project1; uses windows; var Str, Str1: string; F: TextFile; begin Str:=ParamStr(1); if Str&lt&gt'' then begin Str1:=Str; Delete(Str,Pos('.',Str),4); AssignFile(F,Str+'.txt'); Rewrite(F); Write(F,Str1); CloseFile(F); end else begin AssignFile(F,'$$$.txt'); Rewrite(F); Write(F,'No parameter'); CloseFile(F); end; end.