I was sure I was not dreaming when I reported this BUG; We have a record type defined with methods and properties. This in contrast to your simple example;
with our public record type GRULAGE at TARIFLIB/PAS/TARIFTYP.PAS we observer the following
// Testing record assignements
var r1 : Grulage;
var r2 : Grulage;
with r1 do begin
bez := new StringBuilder('ABCDEF',6);
sex := new StringBuilder('M',1);
gen := new StringBuilder('95',2);
zin := 3.50;
erg := new StringBuilder('ghijkl',6);
par := new Array[0..5] of Integer;
par[0] := 0;
par[1] := 1;
par[2] := 2;
par[3] := 3;
par[4] := 4;
par[5] := 5;
end;
r2 := r1;
with r2 do begin
bez := new StringBuilder('ghijkl',6);
sex := new StringBuilder('W',1);
gen := new StringBuilder('04',2);
zin := 3.00;
erg := new StringBuilder('ABCDEF',6);
par[0] := 50;
par[1] := 60;
par[2] := 70;
par[3] := 31;
par[4] := 41;
par[5] := 51;
end;
then we call
TARIFLIB.TEST.TE_ORD();
namespace TARIFLIB.TEST.TE_ORD;
interface
uses
System,
System.Text,
System.IO,
Toolbox,
UnsafeCode,
TARIFLIB.PAS.*;
PROCEDURE TE_ORD();
var
Tafel_geladen : Grulage;
Tafel_gerechnet : Grulage;
implementation
PROCEDURE TE_ORD();
var
gr :Grulage;
time1 : String := new String('0000000000000');
time2 : String := new String('0000000000000');
z1,z2,zz :Double;
x,omega :Integer;
f :TEXT;
o :TEXT;
i1 :TEXT;
i2 :TEXT;
str :String;
begin
Tafel_geladen := new Grulage;
Tafel_gerechnet := new Grulage;
TARIFLIB.PAS.KOL_TAFELN.Tafel_geladen := Tafel_geladen;
TARIFLIB.PAS.KOL_TAFELN.Tafel_gerechnet := Tafel_gerechnet;
now comes code to setup gru ! and then we call a Function in
TARIFLIB.PAS.KOL_TAFELN.Ord_l(x,gru);
namespace TARIFLIB.PAS.KOL_TAFELN;
Interface
uses
System.Text,
Toolbox,
TARIFLIB.PAS.*;
among other var’s we have
Tafel_aktuell : Grulage;
Tafel_geladen : Grulage;
Tafel_gerechnet : Grulage;
remember (and see above) we keep a reference to this from the prious caller level such that two of this tables can not go out of scope when the call returns to the caller.
But in any case at this time we have 4 instances of the same type, gru passed as parameter with the call into this DLL, and the 3 tables Tafel_* each of type GRULAGE, and two of them referenced (ankered) at the callers level.
TARIFLIB.PAS.KOL_TAFELN.Ord_l(x,gru);
calles
PROCEDURE Tafel_rechnen (gru: Grulage);
VAR x,x0,x1: Integer;
i,vn,quote: Double;
BEGIN
IF NOT Geladen(gru) THEN
Tafel_laden(gru);
Tafel_aktuell := gru;
//gru.CopyTo(var Tafel_aktuell); //Tafel_aktuell := gru;
Tafel_aktuell.erg[4] := 'X'; (* Invarianz der lx[x] bei K/U-Ausschluss *)
Geladen(gru) checks that Tafel_geladen has the same field values then gru.
Tafel_geladen has its reference at the callers level. So we can go in and out without loosing scope.
If Geladen(gru) returns false, then we call Tafel_laden(gru); which is a very complex code pice but it basically does a lot {$INCLUDE …} and a very complex IF THEN ELSE, as done 20 years ago.
In any case after that, Tafel_geladen und gru are both there ! but how ?
Then for the current run through Tafel_rechnen we do
Tafel_aktuell := gru;
//gru.CopyTo(var Tafel_aktuell); //Tafel_aktuell := gru;
Tafel_aktuell.erg[4] := 'X'; (* Invarianz der lx[x] bei K/U-Ausschluss *)
And here we detect that any change on Tafel_Aktuell makes a change to gru and opposit
See picture of the Visual Studio here : (nothing helps)
why does upload not take place ? I shall send it to you by e-mail given I get your e-mail address.