#1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dorian C. Chalom Dorian C. Chalom is offline
external usenet poster
 
Posts: 15
Default ALINES

What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the null
field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default ALINES

I do not know what programming language you are using, but in VBA, if you
use

Dim LaData As Variant
LaData = Split("200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS
|VA|20109|99", "|")
For i = 0 To UBound(LaData)
MsgBox LaData(i)
Next i

the null value is returned.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Dorian C. Chalom" wrote in message
...
What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the
null field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default ALINES

FoxPro? Which version?

Is it possible to specify the end-of-line character explicitly in an
additional parameter, and if so, does that make a difference?

Peter Jamieson

http://tips.pjmsn.me.uk

On 01/05/2010 21:48, Dorian C. Chalom wrote:
What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the null
field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dorian C. Chalom Dorian C. Chalom is offline
external usenet poster
 
Posts: 15
Default ALINES

VFP 6.0 and I do not know what the End of Line character is I am working on
determining that.

But I did discover if I do nlines = ALINES(laData, STRTRAN(cStrng, "|",
CHR(10)+CHR(13))) instead of nlines = ALINES(laData, STRTRAN(cStrng, "|",
CHR(13)))
it does take care of the "||" issue. Howeve now I am running into a "|"
{end of line} issue...and it goes on.

Thank you.

"Peter Jamieson" wrote in message
...
FoxPro? Which version?

Is it possible to specify the end-of-line character explicitly in an
additional parameter, and if so, does that make a difference?

Peter Jamieson

http://tips.pjmsn.me.uk

On 01/05/2010 21:48, Dorian C. Chalom wrote:
What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the
null
field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default ALINES

You would be far better off finding a VFP group for help on how to do
this split. (FWIW, it would take me time to set up a VFP system again,
and I'm not familiar enough with the language to suggest an approach
that is liekly to work well). Also, although it may be unlikely that the
| character appears in the data itself, in theory you need to consider
the case where it does - typically, routines that split strings are too
simplistic to do that properly.

Peter Jamieson

http://tips.pjmsn.me.uk

On 02/05/2010 02:14, Dorian C. Chalom wrote:
VFP 6.0 and I do not know what the End of Line character is I am working on
determining that.

But I did discover if I do nlines = ALINES(laData, STRTRAN(cStrng, "|",
CHR(10)+CHR(13))) instead of nlines = ALINES(laData, STRTRAN(cStrng, "|",
CHR(13)))
it does take care of the "||" issue. Howeve now I am running into a "|"
{end of line} issue...and it goes on.

Thank you.

"Peter wrote in message
...
FoxPro? Which version?

Is it possible to specify the end-of-line character explicitly in an
additional parameter, and if so, does that make a difference?

Peter Jamieson

http://tips.pjmsn.me.uk

On 01/05/2010 21:48, Dorian C. Chalom wrote:
What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the
null
field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:16 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"