Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFPScript examples
Message
De
19/06/2000 15:38:36
 
 
À
19/06/2000 15:21:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00381929
Message ID:
00381940
Vues:
14
Greg,

if I understand your problem then you can do it without scripting. I put some code in the BeforeNavigate2 event of my browser controls to call forms or PRGs. This code checks the URL if a VFP form or PRG is to be launched and if so it prevents the default behavior of the browser control (cancel = .T.). The URL has to start with scx:// or prg:// instead of the usual protocol acronyms (http:// or whatever) and will be followed by the path of the form or program to be executed.

The BeforeNavigate2 code snippet might look like this:
LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel

LOCAL lcProtocol,lcURL

lcURL = LEFT(url,6)
IF (lcURL = "scx://") OR (lcURL = "prg://")
  cancel     = .T.
  lcProtocol = SUBSTR(url,7)
  IF RIGHT(lcProtocol,1) = "/"
    lcProtocol = LEFT(lcProtocol,LEN(lcProtocol)-1)
  ENDIF
ENDIF
DO CASE 
  CASE lcURL = "prg://"
    DO &lcProtocol
    RETURN
  CASE lcURL = "scx://"
    DO FORM &lcProtocol
    RETURN
ENDCASE
I've acquired quite a taste for a well-made mistake... [Fiona Apple]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform