Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dialer Classes?
Message
De
12/11/1999 13:54:55
 
 
À
12/11/1999 13:30:00
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00290669
Message ID:
00290683
Vues:
27
>looking for a class (or whatever tricks we need other than classes) that will simply dial a number when the user clicks the button in the 'address book' or whatever...
>
>Anyone seen one lying around?
>
>Harry

I can't remember who posted it, but I saved this code that was posted here quite some time ago:
IF !( 'FOXTOOLS' $ UPPER(SET('LIBRARY')) )
    SET LIBRARY TO FOXTOOLS ADDI
 ENDIF

 LOCAL lccomport,lcdstring,lnport,lcfonelook

 lccomport='COM2'
 lcdstring = "ATDT " + m_fone + CHR(13)

 opencomm  = RegFn("OpenComm", "CII", "I",'User.exe')
 writecomm = RegFn("WriteComm", "ICI", "I",'User.exe')
 closecomm = RegFn("CloseComm", "I", "I",'User.exe')

 lnport = CallFn(OpenComm,lccomport, 100, 100)

 =CallFn(WriteComm, lnport, lcdstring, len(lcdstring))

 lcfonelook=IIF(m_fone='1','1 - '+FONE(SUBS(m_fone,2)),FONE(m_fone))
 =MESSAGEBOX('Dialing '+ALLT(lcfonelook)+CHR(13)+CHR(13)+;
 "Pick up the phone and press any key                  ",64)

 lcdstring=CHR(10)+CHR(13)+CHR(10)+CHR(13)
 =CallFn(WriteComm, lnport, lcdstring, len(lcdstring))
 =CallFn(CloseComm, lnport)

 PROCEDURE FONE
 * Function to return a formatted string from a passed phone number

 PARA pFONE

 LOCAL lcretval
 lcretval=PADL(ALLT(pFONE),14)
 DO CASE
    CASE LEN(ALLT(pFONE))=7
       lcretval=SPAC(6)+SUBS(pFONE,1,3)+'-'+RIGH(pFONE,4)
    CASE LEN(ALLT(pFONE))=10
       lcretval='('+LEFT(pFONE,3)+') '+SUBS(pFONE,4,3)+'-'+RIGH(pFONE,4)
 ENDC
 RETU lcretval
 * eop()
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform