-
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
-
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
-
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
-
Yi Yvonne, I've try..
? MEMOLINE(note2, 200, 1)
return the first 200 char, but:
? MEMOLINE(note2, 200, 2)
return an empty line
-
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
-
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
-
Oh, yeah!
this work fine:
? MEMOLINE(note2, 200, 1, 1, .T.)
? MEMOLINE(note2, 200, 2, 1, .T.)
thanks
Fabio