Jump to content

  • Log In with Google      Sign In   
  • Create Account


[VB] Greater than or equal to and Less than and equal to if statements


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Xooch   Members   -  Reputation: 179

Like
0Likes
Like

Posted 10 July 2013 - 02:39 PM

Hey there,

 

trying to create a simple application which can calculate quotes based on the size of a variable, but having a bit of trouble as I havnt touched Visual Basic in over 5 years.

 

So far I have this

        If width >= 1801 And <= 2000 Then
            price = 1458
        End If

is the width is equal to or larger than 1801 and the width is greater than or equal to 2000 then the price is 1458, although this is saying that the 2nd operator is infact an XML element?

 

Does anyone have an example of a working if statement like this that I can get an idea of?

 

Cheers



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 12946

Like
1Likes
Like

Posted 10 July 2013 - 02:50 PM

Notice how when you said the sentence in English you used "width" twice. You most likely (I don't know anything about Visual Basic) need to do the same thing in code and say `width <= 2000'. Computers are notoriously bad at figuring out things from context.



#3 Xooch   Members   -  Reputation: 179

Like
0Likes
Like

Posted 10 July 2013 - 02:55 PM

That makes sense, I am also lead to believe I can't use 'width' as it's a system variable

        If theWidth >= 1801 And theWidth <= 2000 Then
            price = 1458
        End If

This seems to be working fine now, cheers






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS