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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting lines in a memo field 1

Status
Not open for further replies.

Bryan - Gendev

Programmer
Jan 9, 2011
408
AU
I have a memo field with entries such as


1963/1964
1964/1965
1965/1966
1966/1967
1967/1968


I am using MEMLINES(mfield)to get a count of the number of entries.

when I have a list of 50 entries ( confirmed in Excel rows) the answer I get from memlines = 45.

My user isn't happy with this - how can I get the correct count of the entries please?

Thanks

GenDev

 
Have you consulted the help on MEMLINES()?

"The number of lines in a memo field is determined by the current value of SET MEMOWIDTH."

I tried MEMLINES() with your sample data and that works OK. But that is to be expected, as such short lines don't make MEMLINES count wrong, but longer lines would.

Use ALINES(), if you want to be independant on that, or higher MEMOWIDTH, obviously.

Bye, Olaf.
 
I have memowidth set to 10...

I was thinking the CR would count - 9 does the job - many thanks.
 
Hm, values higher than the longest lines you have should be preferred. Memowidth is a maximum length after which memlines will count a single line as two. Maybe Mike has a point about trailing blank lines you count, but the MEMOWIDTH can't really be too high, just too low.

If you really want to count CHR(13), then take OCCURS(memo,CHR(13)) instead. Or well, use ALINES default.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top