Hi,
I'm using following code to write items to a file using the write_options function. This function only has one parameter and writes the contains of the entire file. Before calling it I'm changing one value in the file (NewID). NOTE: RecINFO is the name of a record and max_discount is an element in the record. When I go back and look at the file the value has changed as I would expect it to however, all the other values in the file have been corrupted. Is my code some how clobbering the other elements in the file or is it more likely a problem with the write-options function? .
Thanks.
procedure TTermIdFrm.TermIdOkBtnClick(Sender: TObject);
var
RecINFO : INFO;
NewID : SmallInt;
begin
if NewTermIdEdt.Text = '' then
ShowMessage('Please Enter New Terminal ID')
else
begin
NewID := StrToInt(NewTermIdEdt.Text);
RecINFO.max_discount := NewID; //Copy New info from form
write_options(@RecINFO); //write new info to options file
NewTermIdEdt.Text := '';
end
I'm using following code to write items to a file using the write_options function. This function only has one parameter and writes the contains of the entire file. Before calling it I'm changing one value in the file (NewID). NOTE: RecINFO is the name of a record and max_discount is an element in the record. When I go back and look at the file the value has changed as I would expect it to however, all the other values in the file have been corrupted. Is my code some how clobbering the other elements in the file or is it more likely a problem with the write-options function? .
Thanks.
procedure TTermIdFrm.TermIdOkBtnClick(Sender: TObject);
var
RecINFO : INFO;
NewID : SmallInt;
begin
if NewTermIdEdt.Text = '' then
ShowMessage('Please Enter New Terminal ID')
else
begin
NewID := StrToInt(NewTermIdEdt.Text);
RecINFO.max_discount := NewID; //Copy New info from form
write_options(@RecINFO); //write new info to options file
NewTermIdEdt.Text := '';
end