Forum > General

How do i use units in my program?

(1/2) > >>

captian jaster:
I know it would be in the uses section but i mean units i made myself.

--- Code: ---uses MyUnit
--- End code ---
i wanna know how to do it
i think itll help me

davesimplewear:
do as you put, seperate each unit with a comma, terminate the statement with a semi-colon eg:
--- Code: ---uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs;
--- End code ---

picstart:
Things to be aware of the uses statement can be in the implementation section or it can be in the interface section. Now if unit1 and unit2 need to share anything  then unit1 (I'm pretty sure needs) to be in unit2's implementation uses and unit2 needs to be in unit1's implementation uses.
The interface uses will generate circular errors if they are there.

Leledumbo:
I think the OP wants to know how to create units. Jsut google for: pascal unit tutorial

captian jaster:

--- Quote from: Leledumbo on March 01, 2010, 07:59:59 am ---I think the OP wants to know how to create units. Jsut google for: pascal unit tutorial


--- End quote ---
Right, thank you! i looked up the pascal unit tut and got some stuff insome wild other language. i understand making the unit but i dont know how to execute a code from the unit

Navigation

[0] Message Index

[#] Next page

Go to full version