Immer gleicher Inhalt
Übersicht

Mashed CrashedBetreff: Immer gleicher Inhalt |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Moin,
Ich hab ein Programm das 3 verschiedene Fenstermodi zu auswahl stellt.( ein standartfenstermodus ist auch enthalten wenn der datei wert leer ist) Standart in der Indexfile:" " Code: [AUSKLAPPEN] a = OpenFile("Index.txt")
If a = 0 Then a = WriteFile("Index.txt") WriteLine a,1 EndIf b = ReadLine(a) winmode = b CloseFile(a) dann: Code: [AUSKLAPPEN] If MouseX() > 40 And MouseX() < 55 Then
If MouseY() > 40 And MouseY() < 52 Then If MouseHit(1) Then winmode = 1 EndIf If MouseY() > 55 And MouseY() < 67 Then If MouseHit(1) Then winmode = 2 EndIf If MouseY() > 70 And MouseY() < 82 Then If MouseHit(1) Then winmode = 3 EndIf EndIf und zum schluss: Code: [AUSKLAPPEN] If winmode = 1 Then <befehl1> ; den modus ändern DeleteFile("Index.txt") a = WriteFile("Index.txt") WriteLine a,1 EndIf If winmode = 2 Then <befehl2> ; den modus ändern DeleteFile("Index.txt") a = WriteFile("Index.txt") WriteLine a,2 EndIf If winmode = 3 Then <befehl3> ; den modus ändern DeleteFile("Index.txt") a = WriteFile("Index.txt") WriteLine a,3 EndIf So, das mit deletefile->writefile , dawar ich mir nicht sicher ob die durch writefile überschrieben wird. Wenn ich nun eine Exe kreiere und die exe ausführt wird immer der fenstermodus 0 angezeigt. gut und richtig. wenn ich ihn jetzt bei der ausführung im programm auf 2 setze das programm schließe wird er in der index datei auf 2 geschrieben, wenn ich nun aber das programm wieder starte und den fenstermodus auf 3 setze bleibt er komischer weise ind er Indexdatei auf 2 Oo kannwer helfen? |
||
![]() |
AraneA |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] Const m_standart = 0
Const m_fullscreen = 1 Const m_window = 2 Const m_window2 = 3 Global modus = m_standart get_modus() Graphics 640,480,16,modus SetBuffer BackBuffer() HidePointer() Repeat choose_modus() Color 255,255,255 Text 320,30,"Modus: "+modus,1,1 Flip:Cls If KeyDown(1) Then set_modus() : End Forever Function get_modus() If FileType("Index.txt") stream = ReadFile("Index.txt") modus = ReadByte(stream) If modus > 3 Then modus = m_standart CloseFile(stream) Else modus = m_standart End If End Function Function set_modus() If FileType("Index.txt") stream = WriteFile("Index.txt") WriteByte stream,modus CloseFile(stream) End If End Function Function choose_modus() Color 255,255,255 Rect 240,90,160,20,0 Rect 240,120,160,20,0 Rect 240,150,160,20,0 Text 320,100,"Fullscreen",1,1 Text 320,130,"Fenster",1,1 Text 320,160,"Fenster skalierbar",1,1 Rect MouseX()-2,MouseY()-2,4,4,1 Color 255,0,0 If MouseX()>240 And MouseX()<400 Then If MouseY()>90 And MouseY()<110 Then Rect 240,90,160,20,0 If MouseDown(1) Then modus = m_fullscreen End If If MouseY()>120 And MouseY()<140 Then Rect 240,120,160,20,0 If MouseDown(1) Then modus = m_window End If If MouseY()>150 And MouseY()<170 Then Rect 240,150,160,20,0 If MouseDown(1) Then modus = m_window2 End If End If End Function |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group