Probleme bei Schleife (weiß net genau was wirklich)
Übersicht

![]() |
ArtemisBetreff: Probleme bei Schleife (weiß net genau was wirklich) |
![]() Antworten mit Zitat ![]() |
---|---|---|
Also bei diesem Code hab ich ein Problem:
Code: [AUSKLAPPEN] Function CREATE_INPUTBOX$(x,y,breite,hoehe) Color 100,100,100 Rect x,y,breite,hoehe rueckgabe$ = x+"°"+y+"!"+breite Return rueckgabe$ End Function Function INPUT_INPUTBOX$(id$) x = Left(id$,Instr(id$,"°")-1) y = Mid(id$,Instr(id$,"°")+1,Instr(id$,"!")-1) breite = Mid(id$,Instr(id$,"!")+1) Color 255,255,0 txt$ = "Das ist ein vorgefertigter Text" If StringWidth(txt$) > breite Then Repeat ausgabe$ = Right(txt$,Len(txt$)-1) Until StringWidth(ausgabe$) < breite Else ausgabe$ = txt$ EndIf Text x,y,ausgabe$ End Function Graphics 800,600,16,2 SetBuffer FrontBuffer() identiti$ = CREATE_INPUTBOX$(10,10,240,FontHeight()) INPUT_INPUTBOX$(identiti$) FlushKeys WaitKey End Wenn ich jetzt diesen Teil hier wegnehme:Code: [AUSKLAPPEN] If StringWidth(txt$) > breite Then Repeat ausgabe$ = Right(txt$,Len(txt$)-1) Until StringWidth(ausgabe$) < breite Else ausgabe$ = txt$ EndIf und das Text x,y,ausgabe$ durch Text x,y,txt$ ersetzte dann geht es aber er schreibt über den Rand der Inputbox? Höngt das Problem mit der Schleife zusammen?? |
||
![]() |
Artemis |
![]() Antworten mit Zitat ![]() |
---|---|---|
und wenn ich das mit goto(*schäm* ![]() Aber er beendet das Prog nicht auf tastendruck sondern hängt irgendwie in der Schleife bzw. goto-konstruktion!! Code: [AUSKLAPPEN] Function CREATE_INPUTBOX$(x,y,breite,hoehe,rahmen = 0)
Color 100,100,100 Rect x-rahmen,y-rahmen,breite+(rahmen*2),hoehe+(rahmen*2) rueckgabe$ = x+"°"+y+"!"+breite Return rueckgabe$ End Function Function INPUT_INPUTBOX$(id$) x = Left(id$,Instr(id$,"°")-1) y = Mid(id$,Instr(id$,"°")+1,Instr(id$,"!")-1) breite = Mid(id$,Instr(id$,"!")+1) Color 255,255,0 txt$ = "Das ist ein vorgefertigter Text" .go If StringWidth(txt$) > breite Then ausgabe$ = Right(txt$,Len(txt$)-1) Goto go Else ausgabe$ = txt$ EndIf Text x,y,ausgabe$ End Function Graphics 800,600,16,2 SetBuffer FrontBuffer() identiti$ = CREATE_INPUTBOX$(10,10,200,FontHeight()) INPUT_INPUTBOX$(identiti$) FlushKeys WaitKey End |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group