Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scan no running
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01418319
Message ID:
01418340
Views:
44
>I managed to replace all SPAM with .T. acording to condtion
>
>Now I want to delete all attached spam files
>
>I am using: DELETE FILE (ALLTRIM(email_anexo.ANEXO) )
>
>But I get "invalid path" message when field content is something like: C:\GERA2\emails\anexos\34468_0::: :::ATT00000
>
>How can I skip such records, to prevent scan to stop ?
>
>
>************************************************************************************
>
>SELECT email_anexo
>scan for EMAIL_ANEXO.SPAM = .T.
>
>MSG = SYS(5)+ CURDIR()+ emails.msg_path
>MSGTX = SYS(5)+ CURDIR()+ emails.msgtx_path
>
> DELETE FILE (MSG)
>DELETE FILE (MSGTX)
>  
>    IF NOT FILE  (anexosPath + ALLTRIM(email_anexo.ANEXO)) 
>    THISFORM.TEXT3.Value =  THISFORM.TEXT3.Value + 1
>    ENDIF
>    *THISFORM.REFRESH
>
>    Should it be here (anexosPath + ALLTRIM(email_anexo.ANEXO)) )

      You may simply put this into try/catch block to "hide"/ignore the errors
      try 
>             DELETE FILE (anexosPath +  ALLTRIM(email_anexo.ANEXO) )
      catch to loException
           ** Could be an invalid path here
     endtry

>
>ENDSCAN
>****************************************
See some comments inside your code.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform