Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Just to add some more information.</p> <p>In a Delphi project, code is organised into units. Each unit is a file with a name and a .pas extention.</p> <p>The unit has the following form:</p> <pre><code>unit Name; interface uses // The definition of these units can be used both in the // interface as in the implementation section. unit1, unit2; // Public interface, visible to other units that use this unit. implementation uses // The definition of these units can be used only in the // implementation section. unit3, unit4; // Private implementation, not visible outside. initialization // code to initialize the unit, run only once finalization // code to cleanup the unit, run only once end. </code></pre> <p>A unit can use anything defined in the unit as long as it is defined before it is beïng used.</p> <p>Sometimes this leads to confusing situations if names are identical:</p> <pre><code>unit1; interface type TTest = Integer; // ... unit2; interface type TTest = Boolean; // ... unit3; interface uses unit1, unit2; var a: TTest; // Which TTest? // ... </code></pre> <p>You can solve this by either knowing the evaluation order, or use a unit prefix:</p> <pre><code>unit3; interface uses unit1, unit2; var a: unit1.TTest; // TTest from unit1 b: unit2.TTest; // TTest from unit2 // ... </code></pre> <p>In your case, you need to use the unit in which Form2 is defined. </p> <p>If the timer is needed by both forms, you can also use a datamodule (just like a form, you can drag nonvisible components to it but they won't be visible). Both forms then can use the datamodule.</p> <p><strong>Edit</strong></p> <p>You try to use:</p> <pre><code>procedure Slide(Form: TForm; Show: Boolean); </code></pre> <p>And TForm has no Timer1.</p> <p>You can do the following:</p> <pre><code>procedure Slide(Form: TForm2; Show: Boolean); </code></pre> <p>If TForm2 is the form containing the Timer.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload