Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using FFC Hyperlink Label for MAILTO in VFP6
Message
De
08/09/1999 04:50:48
 
 
À
07/09/1999 11:02:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00261951
Message ID:
00262292
Vues:
15
>I'm trying to figure out how to use a FFC Hyperlink Label class to provide a MAILTO link on a form (e.g., 'mailto:fred@splat.com'). The problem is that the class seems to prepend 'http://' to the font of the URL if it isn't already there, which makes the browser ignore the 'MAILTO' part.
>
>Can this not be done with Hyperlink Label, or am I perhaps not setting something correctly?
>
>-- jas

Change the validurl method in the _hyperlinkbase class with this code

LPARAMETERS tcURL
LOCAL lcURL

IF EMPTY(tcURL)
RETURN ""
ENDIF
lcURL=ALLTRIM(tcURL)
IF NOT LOWER(LEFT(lcURL,5))=="http:" and NOT LOWER(LEFT(lcURL,7))=="mailto:" AND NOT LOWER(LEFT(lcURL,5))=="file:" AND ;
(LOWER(LEFT(lcURL,4))=="www." OR ;
INLIST(LOWER(RIGHT(lcURL,4)),".com",".gov",".net") OR ;
(NOT SUBSTR(lcURL,2,1)==":" AND NOT LEFT(lcURL,2)=="\\"))
lcURL="http://"+lcURL
ENDIF
IF SUBSTR(PADR(lcURL,5),5,1)==":" .OR. SUBSTR(PADR(lcURL,7),7,1)==":"
lcURL=STRTRAN(STRTRAN(lcURl,"\","/"),"///","//")
ELSE
lcURL="file://"+STRTRAN(STRTRAN(STRTRAN(lcURL,"\","/"),"///","//"),"//","/")
ENDIF
RETURN lcURL
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform