Jump to content

program keeps looping when i type in or


yasha
 Share

Recommended Posts

while $charcnt < 40

if $selectedflag[$charcnt] = 18 or 21 then

end if 

$charcnt = $charcnt + 1

wend

so i tried this  or 21 in my program to see if 2 numbers can run the same program it worked it ran when i typed in 18 and 21 the problem is that it keeps looping when i key it as 21

any ideas on what i am doing wrong or is this a bad usage of the function and how do i make it so 2 numbers run the same program.

thank you in advance as i am very new to programming.

 

Link to comment
Share on other sites

@yasha

The Or statement needs "something" to compare with, so:

If $selectedflag[$charcnt] = 18 Or $selectedflag[$charcnt] = 21 Then
    ; Do whatever you want

EDIT:
Little tips!
You can short this

$charcnt = $charcnt + 1

like this

$charcnt += 1

:)

Edited by FrancescoDiMuro

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...