In the code below strTest updates correctly on the call to ...WvLengthSetting();. However, the subsequent update of strTest, (i.e. strTest := InputStringGrid.Cells[WAVELENGTH_COL,iWvLngthBeingSet]) returns the value the cell contained prior to the attempted update. (Insert swearing emoji here.)
This is called from a timer but the grid is in the same Unit as the timer.
procedure TExitMainForm.WaveLengthBySpecTimerTimer(Sender: TObject);
const
WAVELENGTH_COL : integer = 8;
var
strTest : string = '';
begin
if (SpecWvLengthSetupForm.Visible = false) then
begin
strTest := SpecList[iWvLngthBeingSet].WvLengthSetting();
InputStringGrid.Cells[WAVELENGTH_COL,iWvLngthBeingSet]
:= SpecList[iWvLngthBeingSet].WvLengthSetting();
strTest := InputStringGrid.Cells[WAVELENGTH_COL,iWvLngthBeingSet];
iWvLngthBeingSet := -1;
WaveLengthBySpecTimer.Enabled := false;
end;
end;