As a new Cipper programmer, after wrestling with Memo Fields, I found a
neat way to implement them so that they act like the XBASE memo fields
I was familiar with in Foxpro and dBase. The Function is pretty easy
and should clear up much of the confusion with GETting memo fields.
 
ADDRESS.PRG
#include "box.ch"
#include "inkey.ch"
PROCEDURE MAIN()
phonem="        Phone Field         "
commentm="Comment Comment Comment Comment Comment Comment Comment Comment Comment"
setcolor ("W+/B")
set scoreboard off
set wrap on
CLEAR SCREEN
use address
index on lastname+firstname to name
go bottom
append blank
set scoreboard off
set key K_CTRL_PGUP TO GPHONE
@ 0,0,23,79 BOX B_DOUBLE
@  2,25 say "Clyde and Adrian's Address Menu"
@  5,4  say "First"
@  6,4  get address->firstname
@  5,41 say "Last"
@  6,41 get address->lastname
@  8,4  say "Address"
@  9,4  get address->addr
@  8,56 say "Phone Number"
@  9,47 get phonem
@ 11,4  say "City"
@ 12,4  get address->city
@ 11,24 say "State"
@ 12,24 get address->state
@ 11,34 say "Zip"
@ 12,32 get address->zip
@ 14,4  say "Comments"
@ 15,4  get commentm
@ 23,5 say "Press CONTROL-PGUP to edit Phone or Comment Fields CONTROL-END Saves" read
set key K_CTRL_PGUP TO
clear screen
reindex
CLOSE ALL
return
 
 
PROCEDURE GPHONE
TEMP=0
IF READVAR()="PHONEM"
        TEMP=1
ENDIF
IF READVAR()="COMMENTM"
        TEMP=2
ENDIF
cScrren := savescreen()
setcolor ("W+/B")
DO CASE
        CASE TEMP=0
             clear screen
             restscreen(,,,,cScrren)
             return
        CASE TEMP=1
             @ 22,20 SAY "Type CTRL - W to Save, ESC Cancels"
             setcolor ("n/w")
             replace PHONE with;
             memoedit(PHONE,9,47,13,74)
             setcolor ("W+/B")
             clear screen
             restscreen(,,,,cScrren)
             return
        CASE TEMP=2
             @ 22,20 SAY "Type CTRL - W to Save, ESC Cancels"
             setcolor ("n/w")
             replace COMMENTS with;
             memoedit(COMMENTS,15,4,21,74)
             setcolor ("W+/B")
             clear screen
             restscreen(,,,,cScrren)
             return
ENDCASE
clear screen
restscreen(,,,,cScrren)
