Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Referenced Variables
Message
From
08/04/2008 13:21:32
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
08/04/2008 09:38:33
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01308965
Message ID:
01309080
Views:
12
>>>The values of these variable are populated in the Split_Name function, but they still are empty after the function runs. I must be not using the reference correctly.
>>>
>>>
>>>NewFirstName = ''
>>>NewMidName = ''
>>>NewLastName = ''
>>>
>>>cLastFirst = split_name(Schedule.s_Pat_Name, @NewFirstName, @NewMidName, @NewLastName)
>>>
>>>
>>>
>>>FUNCTION split_name
>>>
>>>	LPARAMETERS tcName , taNewFirstName, taNewMidName, taNewLastName
>>>
>>>	(Other stuff going on here)
>>>
>>>	NewFirstName = SomeNewValue
>>>	NewMidName = SomeNewValue
>>>	NewLastName = SomeNewValue
>>>
>>>	RETURN
>>>
>>>
>>
>>Assign your new values to the parameters, not to the variables.
>>
>>E.g. taNewFirstName = SomeNewValue, etc.
>>
>>BTW, why do you name your parameters ta instead of tc ? ta indicates an array, and this is not your case.
>
>Someone else's code that is being rewritten. Changing the poor naming conventions will be handled too.

I once saw someone use rcNewFirstName to indicate passed by Reference, Character. I've occasionally thought that would be a good thing, but never seem to remember to apply it. :)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform