Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong ATLINE results

Status
Not open for further replies.

k2a

Programmer
Jun 26, 2012
133
DE
While scanning some name and address lines I got some strange results from the ATLINE function. To find out what is going on, I run some test like this:

X1 = "Gxxxxxxx Sxxxxxxxxxxxx Uxxxxx Oxxxxxxxxstr. 56 A D-86156 Augsburg"
?ATLINE('D-', X1) >>> result = 2 but should be 1

X2 = " D-86156 Augsburg"
?ATLINE('D-', X2) >>> result = 1 which is correct

X3 = "1234567890123456789012345678901234567890123456789D-"
?ATLINE('D-', X3) >>> result = 0 but should be 1

x4 = "12345678901234567890123456789012345678901234567890D-"
?ATLINE('D-', x4) >>> result = 2 but should be 1

x5 = "123456789012345678901234567890123456789012345678D-"
?ATLINE('D-', X5) >>> result = 1 correct

It seem that strings longer than 50 characters the ATLINE returns wrong results, at least on my system.

Can anyone tell me if that is a bug or problem on my system?

Thanks
Klaus
 
Check the setting of SET MEMOWIDTH. This determines the width of a line within a memo. ATLINES() is sensitive to that width. The default is 50, so you will probably want to increase it.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Thanks so much Mike, now it works!

Klaus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top