Another Text Box...I need help...

Blitz3D Forums/Blitz3D Beginners Area/Another Text Box...I need help...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Urghh... I hate to revive this topic from the dead, but I have to.
So, I started ANOTHER TEXTBOX. It's going better than the last few(except Ross C's, but I can't use that in 320x240 windowed res.)
However, I've hit a snag. the following code produces the following output.
Function TextBox(T$)
DrawImage textback,160,40
DrawImage frame,42,70,0
For i=52 To 262 
	DrawImage frame,i,70,1
	i=i+9
Next
DrawImage frame,267,70,1

DrawImage frame,277,70,2

For i=20 To 67
	DrawImage frame,277,i,6
	i=i+9
Next

DrawImage frame,277,10,4

For i=47 To 267
	DrawImage frame,i,10,7
	i=i+9
Next

DrawImage frame,42,10,3

For i=20 To 60
	DrawImage frame,42,i,5
	i=i+9
Next

Flip
xx = 47
yy = 20
char$ = ""
temp2$ = ""
temp$ = ""

For i = 1 To Len(T$)
	char$ = Mid$(T$,i,1)
	If char$ = " "
		i2 = i
		Repeat
			char$ = Mid$(T$,i2,1)
			If char$ = " " Then Exit
			temp2$ = temp2$ + char$
			i2 = i2 + 1
		Forever
		If StringWidth(temp$) + StringWidth(temp2$) > ImageWidth(textback) - 20
			For i3 = 1 To Len(temp$)
				Text xx,yy,Mid$(temp$,i3,1)
				Flip
				xx = xx + StringWidth(Mid$(temp$,i3,1))
			Next
			yy = yy + 20
			char$ = ""
			temp$ = ""
			xx = 47
			temp2$ = ""
		EndIf
	EndIf
	temp$ = temp$ + char$
Next






End Function



It doesn't print the rest of it. If anybody could point out my problem, I'd appreciate it.
[EDIT]Anybody? Oops, I forgot the phrase:Pokemon and Mudkip and mother series rock out loud! Woooohoo!