home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 21
/
CD_ASCQ_21_040595.iso
/
dos
/
prg
/
clip
/
sch250
/
dmmemo.prg
< prev
next >
Wrap
Text File
|
1994-12-08
|
2KB
|
54 lines
*****
* A sample programmable text editor.
*****
superbox(00,00,24,79,.t.,"▓",.f.)
superbox(04,09,21,71,.t.,"",.t.)
say(02,25," The Sample Text Editor ")
setcursor(.t.)
*****
* This is the new programmable memoedit() routine. You no longer
* need to define a UDF function (Although this is still available as
* long as it contains no MV variable assignments). Instead, place your
* memoedit() routine into a DO loop and check for specific keys while in the
* loop. Most Control and ALT key combos will exit the memoedit() and allow
* you to check for the system variable 'termkey'.
*
* Define your new memoedit() function as shown below. Be sure to use the
* 'memallkeys' function as the user defined variable and use the column and
* row cursor position variables as shown (see the memoedit() documentation).
*
* Use the setmemo() function to set the system variables moldrow,moldcol,
* mcurrow,mcurcol. Once set, they will maintain the cursor positions in your
* memoedit() function even as you enter, exit and re-enter the memoedit()
* function
*****
mvtext="Press any character key to type. Press any Control or Alt key combo to see the programmable keys... "
setmemo(0,0,0,0)
do while .t.
mvtext=memoedit(mvtext,5,10,20,70,.t.,"memallkeys",60,4,moldrow,moldcol,mcurrow-5,mcurcol-10)
if termkey=27
message("You pressed the ESC key.")
*****
* At this point, you could save mvtext as your modified string
*****
exit
else
message("The key is: "+str(termkey))
endif
enddo
*****
* This is the original memoedit() with the UDF() routine. Note that
* There is no MV variable assignments in the UDF() routine.
*****
mvtext="This is a Memoedit() with a CUSTOM UDF() function"
mv_udfname="dmmemof"
mvtext=memoedit(mvtext,5,10,20,70,.t.,"CUSTOM")
*****
* At this point, you could save mvtext as your modified string
*****
setcursor(.f.)
return