Hey
bin grade dabei ein programm zu schreiben, dass aus 3 Formularen besteht. Ich will eine Variable aus Form1 in Form3 benutzen. aber es tut nicht. so ist die variable deklariert:
Delphi-Quelltext
1: 2: 3:
| var Form1: TForm1; projekt: string = 'Homepage'; |
so wird sie verändert:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7:
| procedure TForm1.ListBox1DblClick(Sender: TObject); begin statusbar1.SimpleText := listbox1.Items.Strings[listbox1.itemindex]; form3.Caption := listbox1.Items.Strings[listbox1.itemindex]; projekt := listbox1.Items.Strings[listbox1.itemindex]; form3.show; end; |
und so wird sie dann im Form3 benutzt:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10:
| procedure TForm3.FormCreate(Sender: TObject); var mm : IXMLNode; begin XMLDocument1.LoadFromFile(extractFilepath(Application.exename) + projekt + '\Info.xml'); mm := xmldocument1.DocumentElement; edit1.Text := mm.ChildNodes['projekt'].ChildNodes['name'].Text; edit2.text := mm.ChildNodes['projekt'].childnodes['kurzform'].Text; edit3.text := mm.ChildNodes['projekt'].childnodes['version'].Text; XMLDocument1.SaveToFile(extractFilepath(Application.exename) + projekt + '\Info.xml'); end; |
ich bekomm aber bei der procedure TForm3.FormCreate immer den fehler, dass der pfad nicht gefunden werden kann. wenn ichs per showmessage ausgeb is es auch einfach leer.
was is da falsch?