Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPAM elimination
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00792787
Message ID:
00793256
Vues:
32
Jeff

I don't want to take too much of your time but maybe 1 more go.

The following code gives variable true is not found. Maybe I am really missing the plot!!

crEATE TABLE Validator (iBad i, iValue i, iMax i)
CREATE TABLE DumbDomains (cDomain c(50))
INDEX ON cDomain TAG cDomain

PUBLIC ofrmvalidate

SET CLASSLIB TO j:\miscdbfs\zipmisc\baseclasses\baseclasses.vcx ADDITIVE

ofrmvalidate=NEWOBJECT("frmvalidate")
ofrmvalidate.Show
RETURN


**************************************************
*-- Form: frmvalidate (d:\users\work\visual foxpro projects\email validator\validator.scx)
*-- ParentClass: frm (t:\baseclasses\baseclasses.vcx)
*-- BaseClass: form
*-- Time Stamp: 05/22/03 11:44:14 AM
*
#INCLUDE "j:\miscdbfs\zipmisc\validator.h"
*
DEFINE CLASS frmvalidate AS frm


Height = 90
Width = 348
Desktop = TRUE
ShowWindow = 2
DoCreate = TRUE
BorderStyle = 1
Caption = ""
MaxButton = FALSE
Icon = "validate.ico"
ovalidator = .NULL.
Name = "frmValidate"


ADD OBJECT tmrcontrol AS timer WITH ;
Top = 66, ;
Left = 324, ;
Height = 23, ;
Width = 23, ;
Enabled = FALSE, ;
Interval = 100, ;
Name = "tmrControl"




*********************
ADD OBJECT oleprogress AS olecontrol WITH ;
Top = 18, ;
Left = 24, ;
Height = 18, ;
Width = 300, ;
TabIndex = 1, ;
Name = "oleProgress", ;
OleClass = "MSComctlLib.ProgCtrl.2"


********************




ADD OBJECT cmgcontrol AS commandgroup WITH ;
AutoSize = TRUE, ;
ButtonCount = 3, ;
BorderStyle = 0, ;
Value = 1, ;
Height = 35, ;
Left = 150, ;
Top = 48, ;
Width = 168, ;
TabIndex = 3, ;
Name = "cmgControl", ;
Command1.Top = 5, ;
Command1.Left = 5, ;
Command1.Height = 25, ;
Command1.Width = 50, ;
Command1.FontName = "Tahoma", ;
Command1.FontSize = 8, ;
Command1.Caption = "\ Command1.TabIndex = 1, ;
Command1.Name = "cmdStart", ;
Command2.Top = 5, ;
Command2.Left = 59, ;
Command2.Height = 25, ;
Command2.Width = 50, ;
Command2.FontName = "Tahoma", ;
Command2.FontSize = 8, ;
Command2.Caption = "St\ Command2.Enabled = FALSE, ;
Command2.TabIndex = 2, ;
Command2.Name = "cmdStop", ;
Command3.Top = 5, ;
Command3.Left = 113, ;
Command3.Height = 25, ;
Command3.Width = 50, ;
Command3.FontName = "Tahoma", ;
Command3.FontSize = 8, ;
Command3.Caption = "\ Command3.TabIndex = 3, ;
Command3.Name = "cmdReset"


ADD OBJECT txtbad AS textbox WITH ;
FontName = "Tahoma", ;
FontSize = 8, ;
Alignment = 3, ;
Enabled = FALSE, ;
Height = 21, ;
InputMask = "999,999", ;
Left = 24, ;
TabIndex = 2, ;
Top = 54, ;
Width = 60, ;
DisabledForeColor = RGB(0,0,0), ;
Name = "txtBad"


PROCEDURE setprogress
LPARAMETERS tiValue, tiBad

WITH This
WITH .oleProgress
.Value = MIN(tiValue, .Max)
liPctg = .Value / .Max * 100
liMax = .Max
ENDWITH

* Projected bad email addresses
.txtBad.Value = IIF(tiBad = 0, tiBad, INT(tiBad / liPctg * 100))

.Caption = ;
ALLTRIM(TRANSFORM(tiValue, "999,999")) + " of " + ;
ALLTRIM(TRANSFORM(liMax, "999,999")) + " - " + ;
ALLTRIM(TRANSFORM(liPctg, "999.9% Complete"))
ENDWITH
ENDPROC


PROCEDURE ovalidator_access
WITH This
IF ISNULL(.oValidator)
.oValidator = CREATEOBJECT("HexValidEmail.Connection")

WITH .oValidator
.FromDomain = "jeffbowman.com"
.FromEmail = "jbowman@jeffbowman.com"
ENDWITH
ENDIF

RETURN .oValidator
ENDWITH
ENDPROC


PROCEDURE dumbdomain
LPARAMETERS tcDomain

LOCAL ;
lcAlias AS String, ;
lcEmail AS String

lcAlias = LOWER(SUBSTR(SYS(2015), 2) + SYS(2015))
lcEmail = lcAlias + "@" + LOWER(tcDomain)

RETURN This.oValidator.Validate(lcEmail, valSMTP) = valSMTP
ENDPROC


PROCEDURE smtp
LPARAMETERS tcEmail AS String, tiError AS Integer

LOCAL ;
lcDomain AS String, ;
lcEmail AS String

LOCAL ;
liError AS Integer, ;
liSMTP AS Integer

WITH This
lcEmail = LOWER(ALLTRIM(tcEmail))

IF .oValidator.Validate(lcEmail, valSyntax) = valSyntax
lcDomain = .oValidator.Domain

IF SEEK(lcDomain, "DumbDomains", "cDomain")
liSMTP = valSMTP
ELSE
IF .DumbDomain(lcDomain)
INSERT INTO DumbDomains (cDomain) VALUES (lcDomain)
liSMTP = valSMTP
ELSE
liSMTP = .oValidator.Validate(lcEmail, valSMTP)
tiError = .oValidator.Error
ENDIF
ENDIF
ELSE
liSMTP = valSyntax
ENDIF

RETURN liSMTP
ENDWITH
ENDPROC


PROCEDURE Init
_VFP.AutoYield = FALSE

WITH This.oleProgress
.Max = RECCOUNT("Emails")
REPLACE iMax WITH .Max IN Validator
ENDWITH

This.SetProgress(Validator.iValue, Validator.iBad)

DODEFAULT()
ENDPROC


PROCEDURE Destroy
CLEAR EVENTS
ENDPROC


PROCEDURE dns
ENDPROC


PROCEDURE syntax
ENDPROC


PROCEDURE tmrcontrol.Timer
LOCAL ;
liRating AS Integer, ;
liError AS Integer

liError = errSuccess

This.Enabled = FALSE

IF Validator.iValue = RECCOUNT("Emails")
ThisForm.cmgControl.cmdStop.Click()
MESSAGEBOX("Processing complete.", icoInformation, "Email Validator")
RETURN
ELSE
GO (Validator.iValue) IN Emails

WITH ThisForm
liSMTP = .SMTP(Emails.cEmail, @liError)

REPLACE ;
iSMTP WITH liSMTP, ;
iError WITH liError ;
IN Emails

IF liError = errRecipientRejected
REPLACE iBad WITH iBad + 1 IN Validator
ENDIF
ENDWITH

REPLACE iValue WITH iValue + 1 IN Validator
ThisForm.SetProgress(Validator.iValue, Validator.iBad)
ENDIF

This.Enabled = TRUE
ENDPROC


PROCEDURE cmgcontrol.cmdStart.Click
WITH This
.Enabled = FALSE

WITH .Parent
.cmdStop. Enabled = TRUE
.cmdReset.Enabled = FALSE
ENDWITH
ENDWITH

WITH ThisForm
.tmrControl.Enabled = TRUE
.Closable = FALSE
ENDWITH
ENDPROC


PROCEDURE cmgcontrol.cmdStop.Click
WITH This
.Enabled = FALSE

WITH .Parent
.cmdStart.Enabled = TRUE
.cmdReset.Enabled = TRUE
ENDWITH
ENDWITH

WITH ThisForm
.tmrControl.Enabled = FALSE
.Closable = TRUE
ENDWITH
ENDPROC


PROCEDURE cmgcontrol.cmdReset.Click
LOCAL lcMsg AS String

lcMsg = "Are you sure you want to reset the validation scan?"

IF MESSAGEBOX(lcMsg, icoQuestion + btnYesNo + btnSecond, "Email Validator") = msgYes
REPLACE ;
iValue WITH 1, ;
iBad WITH 0 ;
IN Validator

ThisForm.SetProgress(Validator.iValue, Validator.iBad)
ENDIF
ENDPROC


ENDDEFINE CREATE TABLE Emails (cEmail c(100), iSMTP i, iError i)
CR
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform