Hi,
If my project target is Debug everything is ok but if i compile is as Release the i face an error at page loading
I found a workaround , it seems that the declared J variable is considered to not be used by the linker because it is only used in asm block.
i just add a fake reference to it and now it works
procedure TCustomStringGrid.UpdateGridAlignment;
var
i,k,l,cw,rh: integer;
j: integer;
al: TAlignment;
begin
if not Assigned(ElementHandle) then
Exit;
if IsUpdating then
Exit;
if (RowCount = 0) or (ColCount = 0) then
Exit;
if FColAlignments.Count = 0 then
Exit;
for i := 0 to FixedCols - 1 do
begin
al := ColAlignments[i];
J:=i; //added to force linker to declare it
if (FixedRows > 0) and (FixedCols > 0) then
begin
Hi,
Problem is generated when Optimization is True in TMS WEB compiler settings
Optimization ON --> J is not declared
this.UpdateGridAlignment = function () {
var i = 0;
var k = 0;
var al = 0;
if (!(this.GetElementHandle() != null)) return;
if (this.IsUpdating()) return;
if ((this.FRowCount === 0) || (this.FColCount === 0)) return;
if (this.FColAlignments.GetCount() === 0) return;
for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
i = $l;
al = this.GetColAlignments(i);
if ((this.FFixedRows > 0) && (this.FFixedCols > 0)) {
for (j = 0; j < this.FFixedColRow.rows.length; j ++){
var tr = this.FFixedColRow.rows[j];
var td = tr.cells[i];
this.SetAlignAttr(al, td);
};
};
Optimization OFF --> J is declared
this.UpdateGridAlignment = function () {
var i = 0;
var j = 0;
var k = 0;
var l = 0;
var cw = 0;
var rh = 0;
var al = 0;
if (!(this.GetElementHandle() != null)) return;
if (this.IsUpdating()) return;
if ((this.FRowCount === 0) || (this.FColCount === 0)) return;
if (this.FColAlignments.GetCount() === 0) return;
for (var $l = 0, $end = this.FFixedCols - 1; $l <= $end; $l++) {
i = $l;
al = this.GetColAlignments(i);
j = i;
if ((this.FFixedRows > 0) && (this.FFixedCols > 0)) {
for (j = 0; j < this.FFixedColRow.rows.length; j ++){
var tr = this.FFixedColRow.rows[j];
var td = tr.cells[i];
this.SetAlignAttr(al, td);
};
};
Thanks for reporting.
You're correct about this issue. We adapted this now. Next release will have this improvement.
Hi , i have updated to latest version today and i face the following problem
if i look in souce code , effectively the tf variable is not defined at line 6421 !!!
procedure TCustomStringGrid.UpdateGridAlignment;
var
i,j,k,l,cw,rh: integer;
al: TAlignment;
begin
if not Assigned(ElementHandle) then
Exit;
if IsUpdating then
Exit;
if (RowCount = 0) or (ColCount = 0) then
Exit;
if FColAlignments.Count = 0 then
Exit;
for i := 0 to FixedCols - 1 do
begin
al := ColAlignments[i];
j := i; // avoid that the optimizer removes j variable
if (FixedRows > 0) and (FixedCols > 0) then
begin
asm
for (j = 0; j < this.FFixedColRow.rows.length; j ++){
var tr = this.FFixedColRow.rows[j];
if (tr) {
var td = tr.cells[i];
if (td) {
this.SetAlignAttr(al, td);
}
}
}
end;
end;
if (FixedCols > 0) then
begin
asm
for (j = 0; j < this.FFixedCol.rows.length; j ++){
var tr = this.FFixedCol.rows[j];
if (tr) {
var td = tr.cells[i];
if (tf) {
this.SetAlignAttr(al, td);
}
}
}
end;
I have replaced tf by td and it works
Of course you are right about this mistake. We fixed it and we'll release an update asap.