Welcome! Log In Create A New Profile

Advanced

Issues with the SELECT command

Posted by BruceV 
Issues with the SELECT command
July 02, 2014 03:40PM
I'm trying to use the SELECT command, but it errors when I run it. I am using Rookie 2.5 - ideas welcome

ERROR
1
case 1General exception address 9d00058c
reset required..

The program is a function which calls the following function
function D()
dim a,b,c
for a = 1 to 13
print a
select(a)
case(1)
print "\n case 1"
break
case(2)
print "\n case 2"
break
...............................etc up to case(13)
default //I have tried with & without this
endselect
next
endf
Re: Issues with the SELECT command
July 02, 2014 06:03PM
hello,
there is a bug that has not been fixed yet when using for/next with select See for more information. The workaround is to use while insted, thus:

function D()
    dim a=13,b,c
    while(a>0)
        print a
        select(a)
            case(1)
            print "\n case 1"
            break
            case(2)
            print "\n case 2"
            break
        endselect
    a = a - 1
    wend
endf 
Sorry, you do not have permission to post/reply in this forum.