Object does not exist...

Übersicht BlitzBasic Beginners-Corner

Neue Antwort erstellen

 

BlitzBasic303

Betreff: Object does not exist...

BeitragFr, Jul 29, 2005 12:24
Antworten mit Zitat
Benutzer-Profile anzeigen
Diese Meldung kommt komischerweise wenn ich die Datei auslese...
In die Datei schreiben:
Code: [AUSKLAPPEN]

fileout = OpenFile("daten.dat")
WriteString fileout, Input1\caption$
WriteString fileout, Input2\caption$
WriteString fileout, Input4\caption$
WriteString fileout, Input5\caption$
WriteString fileout, Input6\caption$
WriteString fileout, Input7\caption$
WriteString fileout, Input8\caption$
WriteString fileout, Input9\caption$
WriteString fileout, Input10\caption$
WriteString fileout, Input11\caption$
WriteString fileout, Input12\caption$
WriteString fileout, Input13\caption$
WriteString fileout, Input14\caption$
CloseFile fileout

das macht er auch richtig und dann das auslesen (Da passiert der Fehler)
Code: [AUSKLAPPEN]

fileout = OpenFile("daten.dat")
Input1\caption$ = ReadString(fileout)
Input2\caption$ = ReadString(fileout)
Input4\caption$ = ReadString(fileout)
Input5\caption$ = ReadString(fileout)
Input6\caption$ = ReadString(fileout)
Input7\caption$ = ReadString(fileout)
Input8\caption$ = ReadString(fileout)
Input9\caption$ = ReadString(fileout)
Input10\caption$ = ReadString(fileout)
Input11\caption$ = ReadString(fileout)
Input12\caption$ = ReadString(fileout)
Input13\caption$ = ReadString(fileout)
Input14\caption$ = ReadString(fileout)
Input15\caption$ = Input1\caption$
Input16\caption$ = Input2\caption$
Input17\caption$ = Input4\caption$
Input18\caption$ = Input5\caption$
Input19\caption$ = Input6\caption$
Input20\caption$ = Input7\caption$
Input21\caption$ = Input8\caption$
Input22\caption$ = Input9\caption$
Input23\caption$ = Input10\caption$
Input24\caption$ = Input11\caption$
Input25\caption$ = Input12\caption$
Input26\caption$ = Input13\caption$
Input27\caption$ = Input14\caption$

Nur zur Info ich mache das ganze mit Escape
(Wers nich kennt: bei EPS in der Signatur)

So beim auslesen sagt er mir: object does not exist. Wieso?

Mfg

BlitzBasic303

Alfadur

BeitragFr, Jul 29, 2005 16:50
Antworten mit Zitat
Benutzer-Profile anzeigen
schau dir die meldung an die der debugger ausspuckt, dort steht auch die stelle an der es passiert. ich würde bei der fehlermeldung mal vermuten das ein objekt nicht existiert (hähä) ... vielleicht solltest du die ganzen inputs beim auslesen erstmal mit "new" erzeugen, hm?
A Cray is the only computer that runs an endless loop in less than four hours.

Kryan

BeitragFr, Jul 29, 2005 19:08
Antworten mit Zitat
Benutzer-Profile anzeigen
kannst ja ma den ganzen quellcode zeigen Very Happy
da steckt der fehler Wink
Webspaceanbieter?
Klick hier!
Kultige Spieleschmiede?
Klick hier!
 

BlitzBasic303

Betreff: RE:

BeitragSa, Jul 30, 2005 9:41
Antworten mit Zitat
Benutzer-Profile anzeigen
also genau liegt der Fehler beim ersten ReadString
Und: Die Inputs habe ich davor schon erstellt(zwischen den beiden Codestücken)

Rallimen

Sieger des 30-EUR-Wettbewerbs

BeitragSa, Jul 30, 2005 9:59
Antworten mit Zitat
Benutzer-Profile anzeigen
wenn das alles in verschiedenen Functionen läuft, dann hast du die evt. nicht Global,
da der Eintrag nicht exitiert beim ansprechen!
[BB2D | BB3D | BB+]

wunderkind

BeitragSa, Jul 30, 2005 11:14
Antworten mit Zitat
Benutzer-Profile anzeigen
Meine Vorredner haben Recht: Zeige uns die Stelle, an der Input1 deklariert wurde etc. Der Fehler liegt vermutlich irgendwo dort.
 

BlitzBasic303

Betreff: RE:

BeitragSa, Jul 30, 2005 13:03
Antworten mit Zitat
Benutzer-Profile anzeigen
Ok dann hier der Ganze Code...
Code: [AUSKLAPPEN]

Graphics 800,600,16,1

Include "system/escape.bb"


Fenster1.eg_window = EG_Window(eg_center,eg_center,400,300,"Firmeneintrag")


txt$ = Chr$(4)+"Eintragen"
Button1.eg_button = EG_Button(Fenster1,50,113,300,39,txt$)

txt$ = Chr$(4)+"Auslesen"
Button2.eg_button = EG_Button(Fenster1,50,213,300,39,txt$)

SetBuffer BackBuffer()
Repeat
   Cls
      
   EG_Main()


   If eg_event_window = Fenster1 Then Exit
   

   If eg_event_button = Button1 Then Goto eintragen
   If eg_event_button = Button2 Then Goto auslesen

   Flip
Until (KeyDown(56) And KeyDown(62))
   
EG_Exit()
End









.eintragen

Fenster1.eg_window = EG_Window(eg_center,eg_center,500,400,"Firmeneintrag")

txt$ = Chr$(4)+"Speichern"
Button1.eg_button = EG_Button(Fenster1,70,290,300,39,txt$)

If eg_event_button = Button1 Then Goto eintragen


Input1.eg_input = EG_Input(Fenster1,10,10,200,"Name")
Input2.eg_input = EG_Input(Fenster1,10,30,200,"Telefon",20)
Input4.eg_input = EG_Input(Fenster1,10,70,200,"Adresse",100,True)
Input5.eg_input = EG_Input(Fenster1,10,90,200,"Straße",100,True)
Input6.eg_input = EG_Input(Fenster1,10,110,200,"Geburtstag",100,True)
Input7.eg_input = EG_Input(Fenster1,10,130,200,"Berufsausbildung",100,True)
Input8.eg_input = EG_Input(Fenster1,10,150,200,"Tätig seit",100,True)
Input9.eg_input = EG_Input(Fenster1,10,170,200,"Bankverbindung",100,True)
Input10.eg_input = EG_Input(Fenster1,10,190,200,"Kontonummer",100,True)
Input11.eg_input = EG_Input(Fenster1,10,210,200,"Bankleitzahl",100,True)
Input12.eg_input = EG_Input(Fenster1,10,230,200,"Bemerkung",100,True)
Input13.eg_input = EG_Input(Fenster1,10,250,200,"Bemerkung",100,True)
Input14.eg_input = EG_Input(Fenster1,10,270,200,"Bemerkung",100,True)

SetBuffer BackBuffer()
Repeat
   Cls
      
   EG_Main()

   If eg_event_window = Fenster1 Then Exit
   
   

If eg_event_button = Button1 Then
fileout = OpenFile("daten.dat")
WriteString fileout, Input1\caption$
WriteString fileout, Input2\caption$
WriteString fileout, Input4\caption$
WriteString fileout, Input5\caption$
WriteString fileout, Input6\caption$
WriteString fileout, Input7\caption$
WriteString fileout, Input8\caption$
WriteString fileout, Input9\caption$
WriteString fileout, Input10\caption$
WriteString fileout, Input11\caption$
WriteString fileout, Input12\caption$
WriteString fileout, Input13\caption$
WriteString fileout, Input14\caption$
CloseFile fileout
End If
   
   
   
   Flip
Until (KeyDown(56) And KeyDown(62))
   
EG_Exit()
End










.auslesen

Fenster1.eg_window = EG_Window(eg_center,eg_center,500,400,"Firmeneintrag")

txt$ = Chr$(4)+"Auslesen"
Button1.eg_button = EG_Button(Fenster1,70,290,300,39,txt$)

If eg_event_button = Button1 Then Goto eintragen


Input15.eg_input = EG_Input(Fenster1,10,10,200,"Name")
Input16.eg_input = EG_Input(Fenster1,10,30,200,"Telefon",20)
Input17.eg_input = EG_Input(Fenster1,10,70,200,"Adresse",100,True)
Input18.eg_input = EG_Input(Fenster1,10,90,200,"Straße",100,True)
Input19.eg_input = EG_Input(Fenster1,10,110,200,"Geburtstag",100,True)
Input20.eg_input = EG_Input(Fenster1,10,130,200,"Berufsausbildung",100,True)
Input21.eg_input = EG_Input(Fenster1,10,150,200,"Tätig seit",100,True)
Input22.eg_input = EG_Input(Fenster1,10,170,200,"Bankverbindung",100,True)
Input23.eg_input = EG_Input(Fenster1,10,190,200,"Kontonummer",100,True)
Input24.eg_input = EG_Input(Fenster1,10,210,200,"Bankleitzahl",100,True)
Input25.eg_input = EG_Input(Fenster1,10,230,200,"Bemerkung",100,True)
Input26.eg_input = EG_Input(Fenster1,10,250,200,"Bemerkung",100,True)
Input27.eg_input = EG_Input(Fenster1,10,270,200,"Bemerkung",100,True)

SetBuffer BackBuffer()
Repeat
   Cls
      
   EG_Main()

   If eg_event_window = Fenster1 Then Exit
   
   

If eg_event_button = Button1 Then
fileout = OpenFile("daten.dat")
Input1\caption$ = ReadString(fileout)
Input2\caption$ = ReadString(fileout)
Input4\caption$ = ReadString(fileout)
Input5\caption$ = ReadString(fileout)
Input6\caption$ = ReadString(fileout)
Input7\caption$ = ReadString(fileout)
Input8\caption$ = ReadString(fileout)
Input9\caption$ = ReadString(fileout)
Input10\caption$ = ReadString(fileout)
Input11\caption$ = ReadString(fileout)
Input12\caption$ = ReadString(fileout)
Input13\caption$ = ReadString(fileout)
Input14\caption$ = ReadString(fileout)
Input15\caption$ = Input1\caption$
Input16\caption$ = Input2\caption$
Input17\caption$ = Input4\caption$
Input18\caption$ = Input5\caption$
Input19\caption$ = Input6\caption$
Input20\caption$ = Input7\caption$
Input21\caption$ = Input8\caption$
Input22\caption$ = Input9\caption$
Input23\caption$ = Input10\caption$
Input24\caption$ = Input11\caption$
Input25\caption$ = Input12\caption$
Input26\caption$ = Input13\caption$
Input27\caption$ = Input14\caption$

End If
   
   
   
   Flip
Until (KeyDown(56) And KeyDown(62))
   
EG_Exit()
End

Alfadur

BeitragSa, Jul 30, 2005 14:40
Antworten mit Zitat
Benutzer-Profile anzeigen
funktionen sind auch DEIN freund....
und manchmal ist weniger mehr, also nur eine hauptschleife bitte.
ansonsten ist der fehler wie schon gesagt, du hast input1 nicht erzeugt. kenn mich mit eps gui zwar nich aus, aber die inputs 1 bis 14 werden ja nur bei eintragen erzeugt, der rest bei auslesen. wenn du gleich auf auslesen klickst ist 1 bis 14 natürlich nich da. so würd ich das mal interpretieren was du da verfasst hast ... vielleicht denkst du nochmal über ne andere struktur nach ...
A Cray is the only computer that runs an endless loop in less than four hours.
 

BlitzBasic303

Betreff: RE:

BeitragSa, Jul 30, 2005 14:55
Antworten mit Zitat
Benutzer-Profile anzeigen
Die Inputs sind feldchen wo du was eingeben kannst. Die hab ich ja erstellt und Input(nummer)\caption$ ist das was drinsteht das kann man endweder eingeben im programm selbst oder z.b. in BB schreiben:
Code: [AUSKLAPPEN]

Input1\caption$ = "hallo"

Das heißt der String is beliebig veränderbar.

Alfadur

BeitragSa, Jul 30, 2005 16:13
Antworten mit Zitat
Benutzer-Profile anzeigen
das ändert nix daran das du die inputs 1 bis 14 nur beim eintragen erstellst, beim auslesen gibt es sie nicht...

btw hab ich gesehen das du ja noch viel größeren bockmist gemacht hast ... diese konstruktion :

Input1\caption$ = ReadString(fileout)
Input2\caption$ = ReadString(fileout)
Input4\caption$ = ReadString(fileout)
Input5\caption$ = ReadString(fileout)
Input6\caption$ = ReadString(fileout)
Input7\caption$ = ReadString(fileout)
Input8\caption$ = ReadString(fileout)
Input9\caption$ = ReadString(fileout)
Input10\caption$ = ReadString(fileout)
Input11\caption$ = ReadString(fileout)
Input12\caption$ = ReadString(fileout)
Input13\caption$ = ReadString(fileout)
Input14\caption$ = ReadString(fileout)
Input15\caption$ = Input1\caption$
Input16\caption$ = Input2\caption$
Input17\caption$ = Input4\caption$
Input18\caption$ = Input5\caption$
Input19\caption$ = Input6\caption$
Input20\caption$ = Input7\caption$
Input21\caption$ = Input8\caption$
Input22\caption$ = Input9\caption$
Input23\caption$ = Input10\caption$
Input24\caption$ = Input11\caption$
Input25\caption$ = Input12\caption$
Input26\caption$ = Input13\caption$
Input27\caption$ = Input14\caption$

ist doch blödsinn.

wie wärs mit

Input15\caption$ = ReadString(fileout)
Input16\caption$ = ReadString(fileout)
Input17\caption$ = ReadString(fileout)
Input18\caption$ = ReadString(fileout)
Input19\caption$ = ReadString(fileout)
Input20\caption$ = ReadString(fileout)
Input21\caption$ = ReadString(fileout)
Input22\caption$ = ReadString(fileout)
Input23\caption$ = ReadString(fileout)
Input24\caption$ = ReadString(fileout)
Input25\caption$ = ReadString(fileout)
Input26\caption$ = ReadString(fileout)
Input27\caption$ = ReadString(fileout)

????

so würde dein programm bestimmt auch funktionieren, weil du aus irgendeinem unerfindlichen grund auf einmal nicht mehr die inputs von 1 bis 14 benutzt, sondern von 15 bis 27...warum auch immer. und wenn du den string dann eh übergibst kannste es auch gleich direkt rauslesen.... dann kommt bestimmt auch kein error ....
A Cray is the only computer that runs an endless loop in less than four hours.

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group