Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is a parameter an array?
Message
From
13/11/2003 06:46:03
 
 
To
13/11/2003 06:26:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00848944
Message ID:
00849454
Views:
22
>Hi Cetin,
>
>TYPE() see only VFP builtin functions, VARTYPE() see any function but not check unknown array.
>
>
>? TYPE("myCalculator(5)"),VARTYPE(myCalculator(5))
>
>FUNCTION myCalculator(k)
> RETURN m.k
>ENDFUNC
>
>
>Fabio

Hi Fabio,

This has been discussed at length in thread#714883

vfp knows the type of the built-in functions.
If the function is not built-in, type() looks for an array.
Failing to find one returns U. Finding one returns the type of the array element
*--------------------------------------------------------------------------
function Do_it()

	?type('myCalculator(3)')	&& U
	
	local myCalculator[10]
	myCalculator = 'abc'
	?type('myCalculator(3)')	&& C	
	
endfunc
*--------------------------------------------------------------------------
function myCalculator(n)
	return n+1
endfunc
*--------------------------------------------------------------------------
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform