Memos [examples]

Adjust the display width of memo fields
SETMEMOWIDTH
set memowidth to 60

https://www.lianja.com/doc/index.php/SET_MEMOWIDTH


Number of lines needed to display a memo field
MEMLINES
use prospect
set memowidth to 40
m_last = memlines(comp_hist)
declare lines[m->m_last]
for n=1 to m->m_last
    lines[m->n] = mline(comp_hist,m->n)
next

https://www.lianja.com/doc/index.php/MEMLINES()


Extract a line of text from a memo
MLINE
use prospect
set memowidth to 40
m_last = memlines(comp_hist)
for n=1 to m_last
    m_line = mline(comp_hist,n)
    ? m_line
next

https://www.lianja.com/doc/index.php/MLINE()


Translate carriage returns
MEMOTRAN
use accounts
m_var = memotran(product_des)

https://www.lianja.com/doc/index.php/MEMOTRAN()


Extract a line of text from a memo field
MEMOLINE
use prospect
m_last = memlines(comp_hist)
for n=1 to m->m_last
    m_line = memoline(comp_hist,40,m->n)
    ? m_line
next
clear

https://www.lianja.com/doc/index.php/MEMOLINE()


Read an external file into a memo field
MEMOREAD
// To transfer company history notes
use prospect
memowrite("tempname.txt",comp_hist)
seek "00234"
if found()
    memoread("tempname.txt",comp_hist)
endif

https://www.lianja.com/doc/index.php/MEMOREAD()


Write to an external file from a memo field
MEMOWRITE
// To transfer company history notes
use prospect
memowrite(tmpnam() + ".txt", comp_hist)

https://www.lianja.com/doc/index.php/MEMOWRITE()


Return the number of word-wrapped lines in a memo field
MLCOUNT
use prospect
m_last = mlcount(comp_hist, 40)
declare lines[m->m_last]
for n=1 to m->m_last
    lines[m->n] = mline(comp_hist, m->n)
next

https://www.lianja.com/doc/index.php/MLCOUNT()


Convert a memo field to character data type
MTOS
string = mtos(notes)
string = string + chr(10) + "AT" + date() +" " + time()
replace notes with string

https://www.lianja.com/doc/index.php/MTOS()


Write from an array into a memo field
ATOM
use "C:\Program Files (x86)\Microsoft Visual FoxPro 9\Samples\Classes\samples.vcx"
goto 34
myarray = mtoa(methods)
list memory
create table temp (tempmemo memo)
use temp
append blank
? atom(myarray,tempmemo)

https://www.lianja.com/doc/index.php/ATOM()


Write to an array from a memo field
MTOA

 

use "C:\Program Files (x86)\Microsoft Visual FoxPro 9\Samples\Classes\samples.vcx"
goto 34
myarray = mtoa(methods)
list memory
create table temp (tempmemo memo)
use temp
append blank
? atom(myarray,tempmemo)

https://www.lianja.com/doc/index.php/MTOA()


Advertisements

Memo field

Q:

I have a table with a Meno field:
select bolnote from boltesta

How do I set the select to read the first 100 characters of the Memo field?

A:

rpad(left(yourmemofield, 100),100)


 

 

 

Memo field

You can’t put “Submit” buttons in a memo field. The memo field is designed to contain “Rich HTML formatted text” not HTML forms which it appears you are trying to do.


Q:
In a section grid I have a memo field. I can not edit it with any command, double click, etc.
A:
Drag the memo field from the columns panel onto the page and an editable webview will be created under your grid. As you navigate records in the grid the webview contents will be refreshed. You may have to relate the grid to the webview section using the relationship builder.
Click on the webview to edit the memo.


Q:
Why does a memo field in a grid appear as a Link? (implying that something will happen when you click on it)
A:
When you shift+Click+drag a table onto a page a grid section is created.
Double click on the section header and you will see some attributes for a “Split Screen” grid.