Hallo,
ich habe folgenden code:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39:
| procedure TForm1.SaveInhalt; var KompoIndex, FormIndex,i:Integer; Components: TComponent; str:String; begin
for FormIndex:=0 to Forms.Screen.FormCount-1 do begin for KompoIndex:=0 to Forms.Screen.Forms[FormIndex].ComponentCount -1 do begin Components := Forms.Screen.Forms[FormIndex].Components[KompoIndex];
if Components is TCheckBox then WriteIni(inifile,'Value',Forms.Screen.Forms[FormIndex].Name+'.'+Components.Name + '.Checked', BoolToStr(TCheckBox(Components).Checked));
if Components is TSpinEdit then WriteIni(inifile,'Value',Forms.Screen.Forms[FormIndex].Name+'.'+Components.Name + '.Value', IntToStr(TSpinEdit(Components).Value));
if Components is TComboBox then begin WriteIni(inifile,'Value',Forms.Screen.Forms[FormIndex].Name+'.'+Components.Name + '.ItemIndex', IntToStr(TComboBox(Components).ItemIndex));
if TComboBox(Components).Tag = -1 then begin for i:=0 to TComboBox(Components).Items.Count -1 do if str <> '' then str:=Str+',' + TComboBox(Components).Items[i] else str:=TComboBox(Components).Items[i]; WriteIni(inifile,'Value',Forms.Screen.Forms[FormIndex].Name+'.'+Components.Name + '.Items', Str); end;
if (TComboBox(Components).Tag = -2) and (FormIndex = 2) then WriteIni(inifile,'Value',Forms.Screen.Forms[FormIndex].Name+'.'+Components.Name + '.ItemsText', TComboBox(Components).Text);
end;
end; end;
end; |
manchmal vertauscht er komponenten so steht an einer stellt wo was andres stehen soll was im falschen form steht.
bei mir sieht es dann so aus:
er nimt sich werte aus einem form wo dieser wert nicht drinen steht. warum ???
in diese procedure muss ein fehler drinen stehen.