Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
External array command
Message
From
16/02/2018 18:35:30
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01658178
Message ID:
01658182
Views:
47
>Hi everybody,
>
>I'm a bit rusty in VFP now and the newly downloaded AppendFromXlsx program complains about an array. I checked my Help file and the sample there is
>
>DIMENSION gaArrayOne(2)      && Create an array
>EXTERNAL ARRAY gaArrayTwo   && Name of the array used in the UDF
>SET TALK OFF
>STORE 10 TO gaArrayOne(1)
>STORE  2 TO gaArrayOne(2)
>= ADDTWO(@gaArrayOne)      && Pass the array by reference to a UDF
>FUNCTION ADDTWO
>PARAMETER gaArrayTwo
>CLEAR
>gaArrayTwo(1) = gaArrayTwo(1) + 2
>gaArrayTwo(2) = gaArrayTwo(2) + 2
>? gaArrayTwo(1)
>? gaArrayTwo(2)
>
>
>My question is - is it possible to just add external array taArray right after the function lparameters declaration?
>
>E.g.
>
>function get_cells
>lparameters lcStr, cCurSheet, cCurStr, laField, tnStartRow, llEmptyCells, tcExcludeColumn
>
>
>laField is an array the PM is complaining about.
>
>BTW, I wish the author of this procedure used the "normal" VFP convention of naming variables and parameters.
>
>Thanks in advance.

I have encountered sometimes the practice of naming parameters not as "t+" when expecting them to be called by reference.
There is some logic in it, as those parameters are not local to called function - at least make certain that is not intended there
Previous
Reply
Map
View

Click here to load this message in the networking platform