NumberFields in Maxgui? Need some help

BlitzMax Forums/BlitzMax Beginners Area/NumberFields in Maxgui? Need some 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.

SuperStrict

Local window:TGadget=CreateWindow("o_O",0,0,640,480)

Local tf:TGadget=CreateTextField(32,32,64,20,window,2)
Local a:String
Local a2:String
Local a3:String
Local t:Int

Repeat
	WaitEvent()
	If EventID()=EVENT_WINDOWCLOSE End
	
	If EventID()=EVENT_GADGETACTION
		If EventSource()=tf
			a=TextFieldText(tf)
			a2=""
			For t=0 Until Len(a)
				a3=Mid(a,t+1,1)
				If Instr("0123456789",a3) ' number found?
					a2:+a3
				EndIf
			Next
			SetGadgetText tf,a2
		EndIf
	EndIf
Forever


I leave it up to you to make a decent function out of it. :P