I have a RichEdit control setup as read only:
CONTROL d1,@RICHEDIT," ",215,37,770,410,0x50800004|@CTEDITRO|@HSCROLL|@VSCROLL,d1_re
and I am using the following code to clear it out after loading info into it:
' Clear RichEdit
l = CONTROLCMD (d1,d1_re,@RTGETTEXTLENGTH)
CONTROLCMD d1,d1_re, @RTSETSELECTION, 0, l
CONTROLCMD d1,d1_re, @RTDELETESEL
The problem is, it is not clearing out the RichEdit. I am working on a program to keep track of recipes for a friend.
I am attaching what I have completed so far with a few recipes for input. All that works so far is I can read in the recipe and determine what the keywords are. NOTHING ELSE WORKS yet. There is a lot of coding not yet in place.
Thanks for any help,
Bill
It appears that a read-only RE control disables the @RTDELETESEL command
So, change this
' Clear RichEdit
l = CONTROLCMD (d1,d1_re,@RTGETTEXTLENGTH)
CONTROLCMD d1,d1_re, @RTSETSELECTION, 0, l
CONTROLCMD d1,d1_re, @RTDELETESEL
to this
' Clear RichEdit
CONTROLCMD d1,d1_re, @RTSETSELECTION, 0, -1
CONTROLCMD d1,d1_re, @RTREPLACESEL, ""
and it will do what you want.
Thank you, that fixed the problem.
Bill