unit test2_lib;
interface
var
fn:String[80];
implementation
end.
//
uses test2_lib;
procedure proc();
var
l:byte;
begin
l:=length(fn);
end;
begin
fn:='ATARI RULEZ!';
proc();
end.
The error occurs regardless of whether the variable is called from a procedure or in the main block.
There is a similar effect with the constants declared in the library, which are used e.g. in the assembler code, although here, one could suppose that it is supposed to be so. Simply, the labels from the main namespace of the library, do not get the equivalent in the main namespace of the program using it Sent As in ASM I can still refer to the namespace of the library, but using test2_lib.fn does not give this effect
The following code should compile smoothly.
The error occurs regardless of whether the variable is called from a procedure or in the main block.
There is a similar effect with the constants declared in the library, which are used e.g. in the assembler code, although here, one could suppose that it is supposed to be so. Simply, the labels from the main namespace of the library, do not get the equivalent in the main namespace of the program using it Sent As in ASM I can still refer to the namespace of the library, but using test2_lib.fn does not give this effect