Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Transform code in function
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Transform code in function
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01594485
Message ID:
01594485
Views:
66
Hi

I developed a code to correct @Hotmail mistypes, but I have to use it in many parts of my software.

Is it possible to transform it in a function, and which part of it can become a function ?
select corrige_email

SCAN FOR corrige_email.email_1 = " "

   
   IF   "@hotmail.com.br" $ corrige_email.email_x  .OR.;
        "@hotimail" $ corrige_email.email_x  .OR. ".co.br" $ corrige_email.email_x .OR. ;
        "@hotemail" $ corrige_email.email_x  .OR.;
        "@hotamil" $ corrige_email.email_x  .OR.;
        "@hotmais" $ corrige_email.email_x  .OR.;
        "@hotml" $ corrige_email.email_x  .OR.;
        "@hotmaiil" $ corrige_email.email_x  .OR.;
        "@hotmil" $ corrige_email.email_x .or.;
        "@hotmill" $ corrige_email.email_x .or.;
        "@hotmaio" $ corrige_email.email_x .or.;
        "@hotmai" $ corrige_email.email_x .or.;
        "@htmail" $ corrige_email.email_x .or. "@homail" $ corrige_email.email_x .or.;                         
        "@hotmaol" $ corrige_email.email_x .or.;
        "@rotmail" $ corrige_email.email_x .or.;
        "@hotmal" $ corrige_email.email_x .or.;
        "@hotm" $ corrige_email.email_x .or.;   && se der certo substitui quase todos
        "@hotmel" $ corrige_email.email_x 
                STORE corrige_email.email_x TO lcValue  
                      
        replace corrige_email.email_1 with  LEFT(lcValue,AT("@",lcValue)-1)+"@hotmail.com"

 

   ENDIF
   
    ENDSCAN
Next
Reply
Map
View

Click here to load this message in the networking platform