May 05, 2024, 04:39:22 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


CASE Question

Started by tbohon, April 10, 2007, 08:10:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tbohon

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
"If you lead your life the right way, the karma will take care of itself ... the dreams will come to you."  -- Randy Pausch, PhD (1961-2008)

GJ

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)