Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array Question
Message
 
 
À
12/10/2000 10:50:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00428486
Message ID:
00428504
Vues:
19
The laTemp array variable loses scope as soon as the method code finishes running. I suggest you create an array property to strore the array values in.
if NOT pemstatus(This, 'aFiles', 5)
   This.AddProperty('aFiles[1]')
endif
Then pick up your code from here with obvious modifications to allow for the array property instead of the array variable.

>I have the following method defined within a class that will attach files to an email object. The method recieves as a parameter either a path or a path and a filename. If it is the path only, I use ADIR() to create an array of the files in said path and cycle through the array attaching all files in that subdirectory. Here is where my question comes in. When the method is called again with a second directory to attach, the varible temp (array that is defined within the ADIR() is not found. I attempted to DIMENSION my temp array before the ADIR() but that leaves me in the same situation. Working on the first call but the second, I have an array filled with logical false like the ADIR() was never executed. When stepping through the line is executed, but the array is not filled with info. Any suggestions are MORE THAN WELCOME. Thank you in advance...
>
>
>Mike
>
>
>LPARAMETER pcFile
>IF right( pcfile, 1 ) = '\'
> ADIR( latemp , pcfile + '*.*' )
> lntotfilestoattach = ALEN( latemp, 1 )
> counter = 1
> for i = 1 to lntotfilestoattach
> lcfilename = latemp[counter,1]
> lcattachfile = pcfile + lcfilename
> oAttachment = ;
> this.oOutlookEmailMessage.attachments.add(lcattachfile)
> counter = counter + 1
> loop
> endfor
>else
>
>IF FILE(pcFile)
> oAttachment = ;
> this.oOutlookEmailMessage.attachments.add(pcfile)
>ELSE
> MESSAGEBOX("File: " + pcfile + "not found")
>EndIf
>
>ENDIF
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform