In case you are confused, the above example should be as follows (var instead of uses):-
Code:
interface
var global_var1 : integer;
global_var2 : integer;
implementation
var local_var1 : integer;
local_var2 : integer;
end.
Note that when you create a new application in Delphi, the IDE generates code that has a variable in the interface section. Form1 is a variable. Simply add your interface variables after the Form1 declaration.
Code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
end.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.