

Function charAt:String(str:String, c:Int) 
	Return Mid(str, c, 1) 
End Function

Function isKeyWord:Int(str:String, c:Int, key:String) 
    Return (Mid(str, c, key.Length) = key) 
End Function

Function GetToke:String(stringa:String,char:String,m:Int)
	     Local s1:String
		 Local n:Int
		 Local i:Int
		 
		 For i=0 To m
           n=Instr(stringa$,char$)-1

           If(n>=0)
            s1=Left$(stringa$,n)
            stringa$=Right$(stringa$,Len(stringa$)-n-1)

           Else
            s1=Right$(stringa$,Len(stringa$)+n+1)

           EndIf
         Next
		 Return s1
End Function
	
Function countToke:Int(stringa:String,char:String)
		Local sMax:Int=Len(stringa$)
		Local count:Int=0
	    For Local i:Int=1 To sMax
          If(Mid(stringa$,i,1)=char$)
             count=count+1
          EndIf
        Next
        Return count
End Function 

Function StringDeleteSpace:String(Stringa:String)
	return Replace(Stringa," ","_")
End Function

Function DrawLineRect(x:Int,y:Int,length:Int,height:Int)
	Local lowerlefty:Int = y+height
	Local lowerrightx:int = x+length
	Local lowerrighty:int = y+height
	Local upperrightx:int = x+length
	DrawLine x,y,x,lowerlefty
	DrawLine x,lowerlefty,lowerrightx,lowerrighty
	DrawLine lowerrightx,lowerrighty,upperrightx,y
	DrawLine upperrightx,y,x,y
EndFunction





