Jump to content

Function Form by Form variable, problem?


eduardo.junqueira

Recommended Posts

Are there any problems with changing the code below?

==================================================

 

function UniForm1: TUniForm1;
begin
  Result := TUniForm1(UniMainModule.GetFormInstance(TUniForm1));
end;
 
 
By the form variable
==================================================
 
type
  TUniForm1 = class(TUniForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
UniForm1: TUniForm1;
 
implementation
 
{$R *.dfm}

 

Link to comment
Share on other sites

  • Administrators

There is a big problem here.uniGUI can not work with global variables. That's why we use a function to retrieve correct instance of a form class for current session.

You can also define a Free Form and create an instance in your code.

var MyForm : TUniForm1;
begin
  MyForm := TUniForm1.Create(UniApplication); 
  MyForm.Show;
end;
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...