Results 1 to 7 of 7

Thread: Use of memowidth

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893

    Use of memowidth

    Hi, I'm try to use memowidth to extract the contents of memofield.
    I've a memo:
    Code:
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    then, I've try with:
    set memowidth to 100
    ? mline(myMemo, 1)
    ? mline(myMemo, 2)
    ? mline(myMemo, 3)

    I expect to see the first 100 char, then the next 100...

    but I see always all the memo..

    where I wrong?

    thanks
    Fabio

  2. #2
    Lianja MVP
    Join Date
    Feb 2012
    Location
    Berea, KY, USA
    Posts
    2,185
    Hi Phabio,

    mline() looks for lines, i.e., a cr/lf or at least an lf. If you have random text in there, you can write the memo out to a file and then use fopen() and fget() from the file.

    How big is this memofield? If it's a reasonable size, there are other methods, like substr(etos(memofield)....),

    Hank

    Hank

  3. #3
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Fabio,

    Also, have a look at MEMOLINE() https://www.lianja.com/doc/index.php/MEMOLINE()

    This gives options to specify the width and to wrap or not.

    Regards,

    Yvonne

  4. #4
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Yi Yvonne, I've try..
    ? MEMOLINE(note2, 200, 1)

    return the first 200 char, but:
    ? MEMOLINE(note2, 200, 2)

    return an empty line

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Hank,
    the memo is not too big.. and I remove all cr lf because I need to export the memo into a XML file.

    Code:
    	for lnI = 1 to ceiling(len(fattura.note2) / 200)
    		lsMemo = substr(fattura.note2, (lnI - 1) * 200 + 1, 200)
    		loDatiGeneraliDocumento.appendChild(XMLCreaNodo(loXML, 'Causale', 					rtrim(lsMemo)))			
    	endfor
    this work fine.

    thanks
    Fabio

  6. #6
    Lianja Team yvonne.milne's Avatar
    Join Date
    Feb 2012
    Location
    Berkshire, UK
    Posts
    1,842
    Hi Fabio,

    Try specifying all the parameters MEMOLINE(<memofield>, <expN1>, <expN2>[,<expN3>,<expL>]) including the <expL>.

    The doc says <expL> defaults to .T., but try setting it to .T.

    <expN3> should be ignored, so just any number.

    Regards,

    Yvonne

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Oh, yeah!

    this work fine:
    ? MEMOLINE(note2, 200, 1, 1, .T.)
    ? MEMOLINE(note2, 200, 2, 1, .T.)

    thanks
    Fabio

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us