Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Objects, Arrays & parameters
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00671447
Message ID:
00671501
Vues:
16
Further to my last message, one can construct one's own reference and pass that.
WITH oInter
 FOR n=1 TO .nInterOpts
   caImportFiles=[oInter.aInterOpts(]+TRANSFORM(.nInterOpts)+[) .aImportFiles]
   caInternalFiles=[oInter.aInterOpts(]+TRANSFORM(.nInterOpts)+[) .aInternalFiles]
   IF .FilesExist(caImportFiles, cImportPath, lSync) AND ;
     .FilesExist(caInternalFiles, cDataPath, lSync)
     .CleanFiles(caInternalFiles, cDataPath, cOutPath, lSync)
   ENDIF
 ENDFOR
ENDWITH
and in your function
FUNCTION FilesExist(caFiles, cPath, lSync, cUser)
		
 lnFiles=ALEN(&caFiles,1)
 IF lnFiles>0			&& Just in case
   lcErrMsg=''
   FOR x=1 TO lnFiles
     IF NOT FILE(cPath+&caFiles(x,1))
	lcErrMsg=lcErrMsg+CHR(13)+[The ]+&caFiles(x,2)+[ file. (]+&caFiles(x,1)+[)]
     ENDIF
   ENDFOR
   :
   :
   :
 ENDIF
The ability to do this oneself makes the limitation on passing properties by reference nonsensical.

Ho hum!!!!


Regards
Geoff Scott




>You cannot pass property by reference. You can either pass whole object or copy property array to the local array, pass that array by reference to the function for processing and than copy back local array into property array.
>
>>I have an array of objects each of which has two arrays as members. I want to be able to pass the member arrays to a function for processing.
>>
>>The problem is that my function does not receive the array, instead it receives only the first parameter.
>>
>>
>>IF FilesExist(.aImportFiles, cImportPath) AND ;
>>   FilesExist(.aInternalFiles, cDataPath)
>>	
>>      CleanFiles(.aInternalFiles, cDataPath, cOutPath)
>>ENDIF
>>
>>
>>
May all your weeds be wildflowers
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform