mechail

Select Case.. End Select | If..ElseIf..Else..End If

In Uncategorized on April 14, 2008 at 5:51 pm

FIDE v1.2 has officially launched!

Meanwhile…

Do take note that while doing this is fine…

Select Case word

case 178 ‘Who

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case 124 ‘What

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case 128 ‘When

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case 218 ‘Where

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case 255 ‘Why

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case else

End Select

Having a commented line on its own in between the cases will trigger a syntax error.

Example:

Select Case word

case 178 ‘Who

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case 124 ‘What

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

‘something like that <==============

case 128 ‘When

keyWords(kwInt) = RDAT(sInt)

kwInt = kwInt + 1

typeState = 1

case else

End Select

And you should always, ALWAYS have a case else right at the end before you End Select.

Speaking of ‘else’;

Something else (no pun intended) that you should take note of would be the IF.. ELSEIF..ELSE..END IF statement, is that it HAS to be in this particular format, unless you’re just using IF..END IF.

So yeah. Till next time!