Dynamic value types to CallLocalFunction
#1

hello, i want call CallLocalFunction with dynamic variable type...(sry for my bad english)

i tried this code:
Код:
((form[funcid][0] == 's')?val[0]:(form[funcid][0] == 'f')?floatstr(val[0]):strval(val[0]))
but i got 2 errors:
Код:
X\pawno\include\loader.inc(165) : warning 213: tag mismatch
X\pawno\include\loader.inc(165) : error 033: array must be indexed (variable "val")
my last chance is 0-8 length formats and 3 type variables with this code:
Код:
	if(strlen(form[funcid]) == 2)
	{
	    /*
	        ii
	        ff
	        ss
	        if
	        fi
	        is
	        si
	        fs
	        sf
	    */
		
		if(form[funcid][0] == 'i' && form[funcid][1] == 'i')
		{ CallLocalFunction(func[funcid],form[funcid],strval(val[0]),strval(val[1])); }
		else if(form[funcid][0] == 'f' && form[funcid][1] == 'f')
		{ CallLocalFunction(func[funcid],form[funcid],floatstr(val[0]),floatstr(val[1])); }
		else if(form[funcid][0] == 's' && form[funcid][1] == 's')
		{ CallLocalFunction(func[funcid],form[funcid],val[0],val[1]); }
	}
anyone know a good solution?
Reply
#2

okay thanks i will try it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)