I'm passing a dialog and a text string to my subroutine. I want to use the 'CASE' construct to decide how to process the text string (command). The first one (quit/bye/exit) works just fine but I can't get anything other than that first one to work.
What am I doing wrong?
Here is the subroutine:
SUB process_cmds(dlg:dialog,text:string)
select text
case "quit"
case& "exit"
case& "bye"
CLOSEDIALOG d1,@IDOK
case "cls"
messagebox("","CLS Command","Not recognized")
' length = CONTROLCMD(dlg, 2, @RTGETTEXTLENGTH)
' CONTROLCMD dlg, 2, @RTSETSELECTION, length, length
' CONTROLCMD dlg, 2, @RTDELETESEL
endselect
RETURN
ENDSUB
The goal in the above is for the 'cls' command to clear out the text in the richedit control but, when that didn't work, I commented those lines out and added the Messagebox command to see if I was even reaching that case statement. The messagebox doesn't appear at all so my guess is that I'm not getting there.
It's probably something simple but darned if I can figure it out.
Tnx.
Tom
Hi Tom,
Change
CLOSEDIALOG d1,@IDOK into CLOSEDIALOG dlg,@IDOK
and
messagebox("","CLS Command","Not recognized") into
messagebox(dlg,"CLS Command","Not recognized")
Think it works ok then , ;)
Regards,
Gertjan (GJ)