I guess the problem is that fNumber
has private access.
Depending on the purpose of this field, one solution could be creating a property to gain write access:
property Number: Integer read FNumber write FNumber;
Then you can do the assignment:
form_array[current_form].Number := Number;
About global variables:
If this is in fact the problem and FNumber
is the "global" variable you are talking about, then you are using the wrong words. FNumber
is a field and belongs to a form. Form members are not global.
Look at the source of your form. If it has been generated by the Delphi IDE you'll find a variable declaration below it:
end; // End of TForm1
var
Form1: TForm1;
implementation
Form1
is a real global variable, because it exists in the interface of a unit and outside of any class and you can access from anywhere (not a good thing in general) as for FNumber
you first need access to a form instance.
PS:
I don't know what exactly you are trying to achive, but perhaps you can take a look at Screen.Forms
which provides a list of the active forms. That might be better suited than a custom list.