kleine input-funktion
Übersicht BlitzBasic
 BlitzBasic  Codearchiv
 Codearchiv|   | ArtemisBetreff: kleine input-funktion |  Do, Jan 06, 2005 21:49 Antworten mit Zitat   | 
|---|---|---|
| nun da ich überall lese, das das mit dem input nicht so klappt hab ich mal ne input function gebastelt. Code: [AUSKLAPPEN] Function selfinput$(writing$,art,start_x,start_y,abstand,font,clear);Abstand ist nur nötig wenn art = 2 ist file = WriteFile("tmp.wrt") If font<>0 Then SetFont font lenny = Len(writing$) Text start_x,start_y,writing$ If art = 1 Then set_x = start_x+lenny*8 Repeat key = WaitKey() If key = 27 Then End If key = 13 Then Exit WriteString(file,Chr$(key)) Text set_x,start_y,Chr$(key) set_x = set_x + 8 Forever CloseFile(file) file = ReadFile("tmp.wrt") While Not Eof(file) ausgabe$ = ausgabe$ + ReadString(file) Wend EndIf If art = 2 Then set_x = 0 Repeat key = WaitKey() If key = 27 Then End If key = 13 Then Exit WriteString(file,Chr$(key)) Text set_x,start_y+abstand,Chr$(key) set_x = set_x + 8 Forever CloseFile(file) file = ReadFile("tmp.wrt") While Not Eof(file) ausgabe$ = ausgabe$ + ReadString(file) Wend EndIf Return ausgabe$ If clear = 1 Then Cls End Function wenn jemand weiß wie ich das machen kann, das er auch die letzten zeichen löschen kann, dringend hierhin schreiben!!! | ||
| cavebird |  Do, Jan 06, 2005 22:07 Antworten mit Zitat   | |
|---|---|---|
| Nett gibbit aber schon   Hmm ich kann an der Umfrage nicht teilnehmen...ist da was kaputt? | ||
| MegaUpload.de -- Uploade bis zu 2MB pro Bild !!DEIN PARTNER IN SACHEN UPLOAD --bitte weiterempfehlen, nur so können wir bekannt werden... | ||
|   | Mr.Keks |  Do, Jan 06, 2005 22:15 Antworten mit Zitat   | 
|---|---|---|
| Ich habe die Umfrage mal gelöscht... War ja irgendwie sinnlos =) | ||
| MrKeks.net | ||
|   | Artemis |  Fr, Jan 07, 2005 13:25 Antworten mit Zitat   | 
|---|---|---|
| nun ich das mal geändert, so dass man auch mit backspace rückgängig machen kann. außerdem wird ein cursor angezeigt, wo man mit der eingabe grade dran ist. Code: [AUSKLAPPEN] Function selfinput$(writing$,art,start_x,start_y,abstand,font);Abstand ist nur nötig wenn art = 2 ist
 If font<>0 Then SetFont font lenny = Len(writing$) Text start_x,start_y,writing$ If art = 1 Then set_x = start_x+lenny*8 Repeat oldausgabe$ = ausgabe$ key = WaitKey() If key = 27 Then End If key = 13 Then Exit If key = 8 And Len(ausgabe$)>0 Then ausgabe$ = Left(ausgabe$,Len(ausgabe$)-1) If key <> 27 And key <> 13 And key <> 8 Then ausgabe$ = ausgabe$ + Chr$(key) EndIf Color 0,0,0 Text set_x,start_y,oldausgabe$+"_" Color 255,255,255 Text set_x,start_y,ausgabe$+"_" Forever EndIf If art = 2 Then set_x = 0 Repeat oldausgabe$ = ausgabe$ key = WaitKey() If key = 27 Then End If key = 13 Then Exit If key = 8 And Len(ausgabe$)>0 Then ausgabe$ = Left(ausgabe$,Len(ausgabe$)-1) If key <> 27 And key <> 13 And key <> 8 Then ausgabe$ = ausgabe$ + Chr$(key) EndIf Color 0,0,0 Text set_x,start_y+abstand,oldausgabe$+"_" Color 255,255,255 Text set_x,start_y+abstand,ausgabe$+"_" Forever EndIf Return ausgabe$ End Function | ||
| getlose |  Fr, Jan 14, 2005 9:27 Antworten mit Zitat   | |
|---|---|---|
| genau die selbe func, nur um die hälfte kürzer   Code: [AUSKLAPPEN] selfinput$(writing$,2,start_x,start_y,20,font) Function selfinput$(writing$,art,start_x,start_y,abstand,font);Abstand ist nur nötig wenn art = 2 ist If font<>0 Then SetFont font lenny = Len(writing$) Text start_x,start_y,writing$ If art=1 Then set_x = start_x+lenny*8 ElseIf art=2 Then set_x = 0 EndIf Repeat oldausgabe$ = ausgabe$ key = WaitKey() If key = 27 Then End If key = 13 Then Exit If key = 8 And Len(ausgabe$)>0 Then ausgabe$ = Left(ausgabe$,Len(ausgabe$)-1) If key <> 27 And key <> 13 And key <> 8 Then ausgabe$ = ausgabe$ + Chr$(key) EndIf Color 0,0,0 Text set_x,start_y,oldausgabe$+"_" Color 255,255,255 Text set_x,start_y,ausgabe$+"_" Forever Return ausgabe$ End Function | ||
|   | Lord_Vader |  Fr, Jan 14, 2005 16:25 Antworten mit Zitat   | 
|---|---|---|
| So was hab ich schon vor 2 jahren geproggt :O (ja als anfänger denkt man nicht logisch genug um das zu können). Also eins müsst ihr noch machen was sehr vorteilhaft ist: Mit cursor tasten hin und her scroll0rn. Trotzdem schöne sache für anfänger sicher brauchbar. Gabs zwar schon öfters aber naja. | ||
| getlose |  Fr, Jan 14, 2005 16:58 Antworten mit Zitat   | |
|---|---|---|
| Zitat: ja als anfänger denkt man nicht logisch genug um das zu können wer hat dir das denn eingetrichtert ? | ||
Übersicht
 BlitzBasic
 BlitzBasic  Codearchiv
 Codearchiv
					Powered by phpBB © 2001 - 2006, phpBB Group
				



