Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is a parameter an array?
Message
De
13/11/2003 06:46:03
 
 
À
13/11/2003 06:26:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00848944
Message ID:
00849454
Vues:
23
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform