Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing file variables to a function
Message
De
15/04/1999 19:02:36
 
 
À
15/04/1999 18:38:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00208655
Message ID:
00208816
Vues:
27
>John,
>
>Thanks for your reply to my question. Unfortunately, when I called SCATTER in the following way:
>
>SCATTER FIELDS (cRecord_field_name), (cFirstname_field_name), ... TO laFieldInfo
>
>where '...' represents the rest of the field names. I got a general syntax error. I set up the values of THIS.record_field_name, THIS.firstname_field_name, etc. by calling the function in my original message. I then declared some LOCAL variables (i.e. cRecord_Field_Name, etc.) and assigned them the values of THIS.record_field_name, etc.
>

What you might try to do is to build a string containing the list of fields to scatter as a single string:

cFieldList = Parm1 + ',' + Parm2 + ',' + ...
SCATTER FIELDS &cFieldList TO laFieldInfo

You can get fairly sophisticated building cFieldList; I'd try passing an array in by reference to create the field list, maybe something like:
FUNCTION MyScatter
* Scatter the fields requested in taFieldList and pass values back in place
LPARAMETERS taFieldList
LOCAL nCtr, nNumRows, cFieldList
nNumRows = ALEN(taFieldList,1)
cFieldList = ''
FOR nCtr = 1 TO nNumRows
   cFieldList = ',' + taFieldList[nCtr]
ENDFOR
cFieldList = SUBST(cFieldList,2)
LOCAL laArray[nNumRows]
SCATTER FIELDS &cFieldList TO laArray
RETURN ACOPY(laArray,taFieldList)
>Have I done something else wrong?
>
>Thanks again,
>
>Henry
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform