Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 Datetime() and timer control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00628798
Message ID:
00628972
Vues:
13
Hello Sergey,

Thanks for the help, I appreciate it very much.

I did as you said and changed the code for the form property, r_cstarttime:

thisform.r_cstarttime = ;
datetime(ln_year,ln_month,ln_day,ln_hours,ln_minutes,ln_seconds)

and now the code in the m_timer method runs okay.

***mlemail.m_timer()
ldt_starttime = thisform.r_cstarttime
ldt_stoptime = ldt_starttime + 2
if datetime() > ldt_starttime and datetime() < ldt_stoptime
thisform.m_email()
This.enabled = .f.
endif
thisform.refresh

Now I have another question about the behavior of Outlook in respect to bad email addresses.

Below is the method that actually sends the emails out.

I tested for bad email addresses because I heard somewhere that this could be problematic and found that my computer doesn't handle them well, it basically hangs and seems to keep trying to send the "bad" email.

Is there a setting or code that would make Outlook skip a bad address?

It also averages about 6 seconds to send each email, does this seem normal or is there a way to make it run quicker. I'm on a LAN and access the internet through an ISDN line and we use MS Exchange for handling email.

Thnaks,
Jim

***mlemail.m_email()
with thisform.Hscntemail
with .Hsoptstatus
do case
case .Option1.value = 1
mstatus = " type <> ' ' " &&&& type = newsletter
case .Option2.value = 1
mstatus = " group <> ' ' " &&&& group = advertising
endcase
endwith
select ;
e_mail, ;
type, ;
group ;
from ;
mail ;
where ;
e_mail <> " " ;
and ;
&mstatus ;
into cursor sys(2015)
#define olfolderdisplaynormal 0
loOutlook = createobject("outlook.application")
lonamespace = loOutlook.getnamespace("mapi")
scan
wait window at 25,50 "Please be patient..." nowait
memailaddress = e_mail
loemailitem = loOutlook.createitem(0)
loemailitem.to = memailaddress
loemailitem.subject = .Hstxtsubject.value
loemailitem.body = .Hsedtbody.value
loemailitem.send()
endscan
looutlook = .null.
release looutlook
endwith
thisform.release


>Hi Jim,
>
>Why do you create thisform.r_cstarttime as a an expression in the string not as a datetime as follows?
thisform.r_cstarttime = datetime(ln_year, ln_month, ln_day, ln_hours, ln_minutes, ln_seconds)
If there's a reason than you have to evaluate the expression stored in thisform.r_cstarttime to get datetime
ldt_starttime = EVAL(thisform.r_cstarttime )
Actually it wouldn't work because all variables in that expression are alreday out of scope at that time.
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform