Error in Select

Hello everyone
Xojo

I am grateful for the interest and scope of the following:

I have a syntax error in the following:

Select CASE Monto
CASE Is <=60000
'operacion 1

CASE (Is >60000 A Is <=240000) 'Error
'operacion 2
CASE Is > 240000
'operacion 3

End Select

Any ideas will be greatly appreciated.

Cordially,
Raúl Juárez Pulache

“A” should be “And”, but that’s still wrong apparently. Try this:

CASE 60001 To 240000

Thank you so much
Andrew Lambert
If I had tried with And
Also with To
but nothing

regards

To should work (works for me). What is the error message?

[code]Select CASE Monto
Case 0 to 60000
'operacion 1

CASE 60001 to 240000
'operacion 2

'CASE Is > 240000 or
case else

'operacion 3

End Select[/code]

It should work, assuming monto is an integer type. What is the error message?

Thank you so much
Andrew Lambert
Jeff Tullin

The code is in a Method that receives as parameters
MontoCalculo of type double and nUit of type double

Select CASE MontoCalculo
CASE Is <=15*nUIT
'operacion 1

CASE Is >15nUIT TO Is <=60nUIT
'operacion 2

CASE Is > 60*nUIT
'operacion 3

End Select

MontoCalculo can have values like 20.52, 100.00, 35.000.30 etc.
nUit can have values like 3800.00,3850.00,3900.00 etc.

some idea, especially to replace:

CASE Is >15nUIT TO Is <=60nUIT

Cordially

Raul Juarez Pulache

[quote]The code is in a Method that receives as parameters
MontoCalculo of type double and nUit of type double[/quote]

So, the first example wasn’t the code you were having trouble with. (Why do people do this?)

[code] dim testval as double
testval = MontoCalculo * nUit

select case testval

case is <=60000
msgbox “low”

case 60000.001 to 240000
msgbox “med”

case else
msgbox “high”

end select
[/code]

Use it like:

Case <= 6000

Forget about “is”

I had to change with the IF then statement so I did not have any drawbacks