Best way to run a batch prog....

I would like to verify the best way to write a batch program....
If creating a batch program, and I place all the code in the main form, (with no CreateForm commands) then I cannot use any of the VCL components unless I dynamically create them, right?  Is there a better way to do this or am I planning this the best way?
In other words, I can't drop any components (lets say label, listbox, and timer) on a form because even making the form invisible still creates it initially and shows it.  I need to create these dynamically in the main file, after removing any CreateForm statements, correct?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

what you are saying is correct just place your code in the main dpr file (view - units - project1) and remove all references to the unit1 and form1 from project.
you may need to add some units to the uses section of the main dpr if your using showmessage() for instance you'd ned to add dialogs etc..
what is your batch program for?
Regards Barry
You could use the command


filename = your file
paramet = parameters behind your filename
sw_show : displays the dosbox, swhide executes the batch-file without showing the dos-window.


You also have to put the link to the directory where fmxutils are in Tools->Environment options :

c:\program files\borland\delphi5\demos\doc\filmanex

jexd99Author Commented:


    There is no way to add/drop components from the VCL in this case is there (when using only the main dpr)?  I think the only option is to dynamically create these as needed, but I just want to make sure before I get too deep into this. :)

(Also how to I give you the points for this when you weren't the first answer?)

Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

If you want to give Inthe the points, you could reject my answer :-)
yes you have it all straight in your head :-)
you can only create them dynamically (and only components that dont need a form(canvas property etc) if your not going to have a form ;-)so you couldnt create a tlabel but you could create a
ttimer or use a stringlist but not a memo etc.. you know what i mean .
if you dont know the easist way to remove the default form from a new project you can go to the menu in delphi and choose project - remove from project and choose unit1,form1 then after removeing go to menu item view and choose unts and choose project1.that should set it up to start.

you probably know but you must remember to free these thing you create as well .
i was asking about waht the batch was going to do because i wondered if you knew you could create .bat files in code if you needed.

oh and theres an option on this page   to reject / accept answers .. sorry batalf :-)
jexd99Author Commented:

Thanks for the answer, thats what I thought but I wanted to be sure before I got to deep into it.  I've done these things before then found out later that I could have done things much easier! :-)

Thanks for your answer too batalf, I need to do this in delphi so I can't use a dos bat file, I think we just misunderstood each other on the question. :)

(Inthe, go ahead and answer this question so I can give you the points)
ok cheers,
if you have any troubles you know where to come :-)
well do our best to help further.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.