select case in mikro basic

Status
Not open for further replies.

peterzatko

New Member
I need to help with select case .How to call a function in case by a number?????????????
Code is in mikro basic.
Please read a code .


..........

Dim i as integer

select case s

case 0
PORTB = %00111111

case 1
PORTB = %00000110

............

case 9
PORTB = %01101111

end select

loop:

For i = 1 to 9

next i

if i = 0 do in case0 ????????? How call function in case 0
if i = 1 do in case1 ??????????How call function in case 1
......
.....
....
if i = 9 do in case9 ????????How call function in case 9

goto loop


.............
 
You can use select case like this.

Code:
select case s          
    case 0  functionNameA()
    case 1  functionNameX()
    case 2  ...

  end select                                  'case end
end sub
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…