Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is the purpose of LPARAMETERS
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01601772
Message ID:
01601787
Vues:
73
The 'local' refers to *scoping* of the variables that are passed into the function called not the 'By Value or By Reference' status. Those are two completely unrelated concepts.

By default FoxPro uses PRIVATE variable scope and PARAMETERS uses Private scope as well. LPARAMETERS basically just makes the parameters LOCAL and scope to the function.

So think of PARAMETERS and LPARAMETERS as the difference between:
PRIVATE Parm1, Parm2
and
LOCAL Parm1, Parm2
If you recall PRIVATE scope is hierarchical - visible down from where a variable is declared all the way into child functions/methods called. LOCAL scope is local to the function the variable is declared at. So LPARAMETERS limits the scope of the parameters - where they are visible - to the function they are declared in.

It has nothing to do with passing by value or by reference.

+++ Rick ---

>Hi,
>
>Specifically I mean, as far as the title, what is the purpose of the "L" in LPARAMETERS. I understand it means "local" but the following example shows that it is not quite local:
>
>
>LOCAL lVar1, lVar2
>
>STORE 1 TO  lVar1, lVar2
>
>=TestFunct( lVar1, @lVar2 )
>
>? lVar1, lVar2
>
>FUNCTION TestFunct
>LPARAMETERS lVar1, lVar2
>
>lVar2 = 122
>
>RETURN
>
>
>Or does it mean that the "@" overrides the L in LPARAMETERS?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform