Darn, why is this happening?

Blitz3D Forums/Blitz3D Beginners Area/Darn, why is this happening?

Be sure that the first time a variable is used you always give up the type of the var... Elseway it will always be seen as an integer...

As you can see in Fredlogs example the first c is called as c$... Once that's done you don't have to use the $ anymore to tell Blitz since Blitz will memorize it...

If you are not sure when c is used the first time, you could declare if first, then you are sure you'll never see any surprises... Like this...

Function parser$(txt$)
Local c$
	occurence = occurence(txt$," ")
	Dim parserreturn(occurence+1)
	For a = 1 To occurence
		Repeat
			b = b + 1
			If Mid$(txt$, b, 1) <> " "
				c = c + Mid$(txt$, b, 1)
			Else
				endloop = 1
				parserreturn(a) = c
			EndIf
		Until endloop = 1
		endloop = 0
		c = ""
	Next
	b = b + 1
	parserreturn(occurence+1) = Mid$(txt$, b)
	Return occurence+1
End Function


Just always use the symbol in the first time you use a var, either when you use it for the first time or in a declaration with either "Global" or "Local"....