Jump to content
Sign in to follow this  
yasha

program keeps looping when i type in or

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.

 

Share this post


Link to post
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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites

@yasha
You're welcome :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...