Hi,

REALbasic 2006 Release 3
Mac OS X 10.4.7

The question is: how can I do what the example code below suggest I want to do!

[In Window.MouseDown] I wanted to use Select Case, tried some solutions and fall into:

 Select Case Y
Case Is < 100 // Was: Y < 100 // Row #1
   startY = 0
   endY   = 100
Case Between(Y,100,200) // Was: Is > 100 And Is < 200 // Row #2
   startY = 100
   endY   = 200
Case Between(Y,200,300) // Was: Is > 100 And Is < 200 // Row #3
   startY = 200
   endY   = 300
Case Between(Y,300,400) // Was: Is > 100 And Is < 200 // Row #4
   startY = 300
   endY   = 400
Case Between(Y,400,500) // Was: Is > 100 And Is < 200 // Row #5
   startY = 400
   endY   = 500

 End Select

But this does not works:

Type mismatch error. Expected Int32, but got Boolean.
Select Case Select Case Y


Why ?

BTW: Between is, according the Language Reference, a Function that returns True when the Y passed value is between the two int32 values.

I will get True if Y value is between 100 and 200:

Between(Y,100,200)

Before explaining to me that Y is a Int32 (or Integer), consider my previous attempts that failed:

Case Y > 100 And Y < 200

Case Is > 100 And Is < 200

At last consider also that it tooks me sometimes to figure what ls was in fact IS (not LS)... UpperCase i followed by a LowerCase s...

What was my work-around ? after considering to use a Variant (say myY As Variant, Select Case myY), I commented the whole Select blick and use a good old If .../... ElseIf .../... End If block.

I still have a problem, but this may be my fault on another part of the code (I am not able to fill the window background:
   g.ForeColor = cmy(0,0,0.12)
   g.FillRect    0,startY,0,endY

Yes, I have a bit of work to do there)


Regards,


Emile

PS: Stupid, stupid me (sometimes only, fortunately)... I just have to change the last 0 to Self.Width ! (FillRect 0,startY,Self.Width,100) - yes, endY was false too. That was an alpha draft !
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to