Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any Counter For Array? I can't find it if passing parame
Message
De
04/03/1998 04:23:38
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/03/1998 03:38:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00082426
Message ID:
00082429
Vues:
32
>I want to know the array size of a passing array!
>e.g.
>
>Aused(NumUsedTable)
>CallFunc(NumUsedTable)
>
>Define Function CallFunc
>Lparameters AryName
>
>* then?

If you didn't touch the defaults, parameters are passed by value, DO..WITH pass params by reference regardless of "SET UDF ..". When you pass an array to a function, as you did, by value you actually pass the value of first item, not the array itself. To pass the array you should pass it by reference. To do it regardless of "SET UDF.." precede it with an "@" sign.
=Aused(aNumUsedTable)
=CallFunc(aNumUsedTable)

* Callfunc
lparameters aNumTables
? aNumTables    && First tablename
? aNumTables[2] && Produce error - aNumTables is not an array

=Aused(aNumUsedTable)
=CallFunc(@aNumUsedTable)

* Callfunc
lparameters aNumTables
? aNumTables    && First tablename
? aNumTables[2] && Second tablename and so on
Beware when you pass by reference you're actually passing the address of var so if the function changes the value it would be changed upon return.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform