A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

ALINES



 
 
Thread Tools Display Modes
  #1  
Old May 1st, 2010, 09:48 PM posted to microsoft.public.word.mailmerge.fields
Dorian C. Chalom
external usenet poster
 
Posts: 47
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  
Old May 1st, 2010, 10:20 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
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  
Old May 1st, 2010, 11:19 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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  
Old May 2nd, 2010, 02:14 AM posted to microsoft.public.word.mailmerge.fields
Dorian C. Chalom
external usenet poster
 
Posts: 47
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  
Old May 2nd, 2010, 10:30 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
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)




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.