Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Objects, Arrays & parameters
Message
From
23/06/2002 17:23:24
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00671447
Message ID:
00671501
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform