I have a form with a single rich edit box (window is 'w', control ID is '8') and I'm trying to do the following:
Copy the data from the box to a string, parse the string elimininating all chr$(10) and chr$(13) (cf/lf pairs) and rewrite the cleaned string back to the same rich edit box. What I'm getting is a blank rich edit box after I write it ... so I'm thinking that perhaps the SELECT-CASE is malformed.
Here's the code involved:
wvar1$ = ""
wvar2$ = ""
wvar3$ = ""
rv = CONTROLCMD(w,8,@RTSAVE,wvar1$)
for j=1 to len(wvar1$)
c$ = mid$(wvar1$,j,1)
SELECT c$
CASE chr$(10)
CASE chr$(13)
DEFAULT
wvar2$ = wvar2$ + c$
END SELECT
next j
CONTROLCMD w,8,@RTSETSELECTION,0,-1
CONTROLCMD w,8,@RTDELETESEL
CONTROLCMD w,8,@RTLOAD,wvar2$
At what point am I going wrong here?
Thanks in advance.
Tom
The SELECT CASE is fine. Try putting a type indicator as the last argument on that @RTLOAD command. 0=ASCII, 1=RTF.
CONTROLCMD w,8,@RTLOAD,wvar2$,0
SELECT c$
CASE chr$(10)
CASE& chr$(13)
DEFAULT
wvar2$ = wvar2$ + c$
END SELECT
CASE& is used for grouping case labels together.
Note to self: Read the documentation ... read the documentation ... read the documentation ... ::)
Thanks, Paul.
Damn clever use of SELECT...CASE, I must say....