Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Supporting Legacy Application (email issue)
Message
 
À
30/04/2004 19:38:49
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00899971
Message ID:
00899980
Vues:
17
What you want to do is to stop your program in the debugger just before where it's getting the error, then step through till it blows up. Probe around at variable values and determine exactly what's causing it.

You can set a breakpoint by double-clicking in the left margin of the code window in design time, but the debug window has to be open for the breakpoint to happen.

Easier, I often find, is to just put the two lines:
DEBUG
SUSPEND

in the code where I want it to stop. For example:

>
>Mew Code:
>
> LOCAL loSession, loMessage, loRecip
>

DEBUG
SUSPEND

> loSession = CREATEOBJECT("MAPI.Session")
> KEYBOARD "{ENTER}"
> loSession.Logon()
>
> loMessage = loSession.Outbox.Messages.Add()
> loMessage.Subject = MailSubject
> loMessage.Text = MailMsg
>
> IF TYPE('emailaddress')='C' .and. !EMPTY(emailaddress)
> loRecip = loMessage.Recipients.Add()
> loRecip.Name = ALLTRIM(emailaddress)
> loRecip.Type = 1 && This is a To, not a CC or BCC
> loRecip.Resolve() && This will validate the name you put in above
> ENDIF
>
> IF TYPE('e2')='C' .AND. !EMPTY(e2)
> loRecip = loMessage.Recipients.Add()
> loRecip.Name = ALLTRIM(e2)
> loRecip.Type = 3 && This is a To, not a CC or BCC
> loRecip.Resolve() && This will validate the name you put in above
> ENDIF
> IF TYPE('e3')='C' .AND. !EMPTY(e3)
> loRecip = loMessage.Recipients.Add()
> loRecip.Name = ALLTRIM(e3)
> loRecip.Type = 3 && This is a To, not a CC or BCC
> loRecip.Resolve() && This will validate the name you put in above
> ENDIF
> IF TYPE('e4')='C' .AND. !EMPTY(e4)
> loRecip = loMessage.Recipients.Add()
> loRecip.Name = ALLTRIM(e4)
> loRecip.Type = 3 && This is a To, not a CC or BCC
> loRecip.Resolve() && This will validate the name you put in above
> ENDIF
> loMessage.Update()
> loMessage.Send()
> loSession.LogOff()
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform