Autor Beitrag
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 18:43 
[Fehler] Unit3.pas(33): Undefinierter Bezeichner: 'savedialog1'

das ist alles was ich als fehler gemaldet bekomm... und nun ???
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 21.02.06 18:44 
Du hast den SaveDialog aufs Formular gepackt? Der liegt im Register Dialoge.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 18:47 
hatte vergessen savedialog1 als variabel entsprechend zu vermerken...
trotzdem geht's nch nicht... bekomm währen des probelaufes eine exception vom debugger...keinplan ...
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 21.02.06 18:49 
Fehlermeldung und betreffenden Codeschnipsel posten.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 18:55 
im projekt project1.exe ist eine exception der klasse EAccessViolation aufgetreten. Meldung : 'zugriifsverletzung bei Adresse 00458b03 in modul ' project1.exe'.lesen von adresse 0000000000'. process wurde angehalten it einzelne anweisung (...)

kannst du mit dem gefritzel was anfangen?!?!?!?!?!?

ich nich...
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 21.02.06 18:59 
Zugriffsverletzungen sind immer Murks :roll:
Poste mal den Code!

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 19:01 
der quellcode für den button lautet :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
 procedure TForm3.bt_speichernClick(Sender: TObject);
begin
if savedialog1.execute then
begin
m_1.lines.savetofile(savedialog1.filename);
end


das ist alles, mein memo fentser hat die name egenschaft m_1...

Moderiert von user profile iconGausi: Beitragsformatierung überarbeitet.
Milhouse2500
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 33

Win 2000, Win XP
D5 Prof, D7 Enterprise
BeitragVerfasst: Di 21.02.06 19:03 
Hast du denn einen SaveDialog ober aus der KomponentenLeiste ausgewählt und aufs Formular gesetzt oder einfach nur eine Variable vom Typ TSaveDialog im Quelltext hinzugefügt?

Die Fehlermeldung deutet darauf hin das du versuchst auf ein Objekt zuzugreifen, welches noch nicht erzeugt wurde.
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 19:04 
glaub er hat probleme mit der zeile, die markiert er immer grün wenn der fehler auftritt :

if savedialog1.execute then

wüsst aber nicht was daran falsch ist...
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 21.02.06 19:04 
Ich habe gesagt aus der Palette aufs Formular ziehen ;)

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 19:07 
hab schon alles aus der komonentenleiste, außer die sachen,die ich tippen muss, wie zum beispiel bei der zeile das savedialog

if savedialog1.execute then...

ansonsten alles augewählt...
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 21.02.06 19:12 
Wenn ich jetzt nicht auf der Leitung stehe, dann weiß ich nicht, wo der Fehler liegt. Kannst ja mal den Debugger zur Fehlersuche benutzen.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
zivi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 21.02.06 19:26 
ich weiß es auch nicht, und selbst mein vater, edv-organisator mit eigener firma weiß es nicht... muss ich mal schauen... vielen dank für deine bemühungen...

mfg josh...aka zivi
T3cn0
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Mo 27.02.06 16:51 
hallo,

ich bin auch grad dabei so ein programm zu machen wo man was in ein memo eingeben kann und es dann speichert.
Im Moment hab ich auf meiner Form ein Memo und einen Button...der Butten hat folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
procedure TForm2.Button1Click(Sender: TObject);

begin
memo1.lines.savetofile('c:\test2.txt')

end;

end.


jetzt möchte ich es aber so machen das man noch auswählen kann wohin und unter welchem namen die datei gespeichert wird.
ihr habt ja auch schon diesen code hier gepostet:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
//wenn der Savedialog geschlossen wurde,    
if savedialog1.execute then   
begin   
//Den Text in dem Pfad speichern, der ausgewählt wurde (savedialog1.filename)   
memo1.lines.savetofile(savedialog1.filename);   
end



hab ich auch schon probiert aber wo muss ich den code einfügen???

(ich weiß es is eine neewbe frage ich hoff trotzdem ihr antwortet mir)

danke schon im vorraus.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 27.02.06 17:18 
Alle haben mal klein angefangen ;)
Dort einfügen, wo die Abfrage zum Speichern erfolgen soll. Gewöhnlich im OnClick des Speichern-Buttons.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
azubi_20
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 593

WinXP SP2, Ubuntu 8.4
D7 Enterp., D2005 Prof., Java (Eclipse 3.4.0)
BeitragVerfasst: Mo 27.02.06 17:20 
Der Code offnet den Standard-Dialog "Speichern unter ... ", wie du ihn in vielen Programmen findest. Platziere ihn dahin wo du deinen Text abspeichern möchtest. Wenn du also einen Button hast, nach dessen Klick gespeichert werden soll, plazierst du den Code in diese Prozedur.
T3cn0
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Mo 27.02.06 17:30 
ok danke das funktioniert mal.


so jetzt hab ich noch ein anderes fenster.dort hab ich ebenfalls ein Memo1, einen button und jetzt aber ein opendialog.

ich hab beim button on klick jetzt eingegeben das er dann den opendialog öffnen soll.

das macht er auch alles ok.

aber wie kann ichs jetzt machen das er die datei dann wieder im Memo1 öffnet?
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 27.02.06 17:41 
So geht das ;)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if opendialog1.execute then
begin
  memo1.lines.loadfromfile(opendialog1.filename);
end;

Alles klar?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
T3cn0
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Mo 27.02.06 17:44 
Ok super! funktioniert!


danke für die schnelle hilfe!

mfg T3cn0
T3cn0
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Mo 27.02.06 19:55 
So nochmal ich :-)

das is jetzt mein bisheriger code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
procedure TForm2.Button1Click(Sender: TObject);
var
  i:Integer;
  StringList:TStringList;
begin
  StringList := TStringList.Create();
  StringList.BeginUpdate();
  for i:=0 to ComponentCount-1 do
  begin
    if Components[i] is TEdit then
    begin
      StringList.Add( TEdit(Components[i]).Text );
    end;
    if Components[i] is TMemo then
    begin
      StringList.Add( TMemo(Components[i]).text );
    end;
  end;
  StringList.EndUpdate();
  StringList.SaveToFile( 'c:\myEditFelder.txt' );
end;


wenn ich jetzt irgendwas in meine beiden memos reinschreib und speichern drück speichert der der is die datei C:\myEditFelder.txt wie oben angegeben.

wie kann ichs machen das ich noch mit meinem savedialog1 auswählen kann wohin und unter welchem namen ich des speicher??

mfg T3cn0