Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug in VFP9?
Message
De
29/03/2019 05:53:32
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01667575
Message ID:
01667671
Vues:
62
J'aime (1)
>I have related question. I think I recall that calling someFunction(@tcLongString) is quicker than someFunction(tcString) if we don't make any changes with tcString inside the function.
>
>Do I remember correctly and it's indeed better to use first syntax?
>
>Thanks in advance.

When you pass by reference (using @tcLongString) syntax, any code references made to the string result in the local value (from the caller) being updated as well.
* Example without by reference calling:
lcString = "Hi, mom!"
? "Before: " + lcString
test_function(@lcString)
? "After: " + lcString

? "-----"

lcString = "Hi, mom!"
? "Before: " + lcString
test_function(lcString)
? "After: " + lcString


FUNCTION test_function
LPARAMETERS tcString
tcString = CHRTRAN(tcString, "m", "-")
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform