WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Postie

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Keywords: 

Question:

I trying to get mail messages with a pattern no pattern option. But I always get all the mail messages.

I'm working with the Postie extender WWPST32i.ddl from 07-03-00.

The subject field of some of the messages is the text:

Answer:

Here's some clarification on how pattern matching works in kGetMail.
  1. pat and nopat are mutually exclusive; you can use one or the other but not both. So do NOT specify both inadvertently by doing something like: strcat(pat,"|",nopat), where nopat="". That will not work. Either specify:
    msgs=kGetMail('','mail.dat','Thistle','','')  ; pat match
    
    or
    msgs=kGetMail('','mail.dat','|Butterfly','','') ;nopat match
    

  2. If you use the nopat, the vertical bar must precede it so we know it's the nopat option that's getting passed through.

  3. To do substring matches in subject titles, you can use the wildcard characters in the "pat", eg.,
    msgs=kGetMail('','mail.dat','*Thistle*','','r4')
    
    but do not use the wildcard character matching in the "nopat" option. Nopat has the ability to search for substrings within Subject strings.
The help file has been changed as follows:
Syntax:

kGetMail(msgnumber,outputfile,pat,mailfolder,flags)
OR
kGetMail(msgnumber,outputfile,strcat("|",nopat),mailfolder,flags)


"pat" is the wildcard pattern the subject of the email must match to
process message (otherwise it is skipped.)  "pat" and "nopat" are
mutually exclusive; you cannot specify both.

"nopat" is the wildcard pattern the subject of the email must not match
to process message (otherwise it is skipped).  To specify "nopat", you
must put a vertical bar "|" before the "nopat", e.g., 
kGetMail('','mail.dat','|Butterfly','','').  "pat" and "nopat" are
mutually exclusive; you cannot specify both.

Article ID:   W14544
Filename:   kGetMail and Pattern Matching.txt
File Created: 2017:07:28:12:58:35
Last Updated: 2001:03:16:13:43:28