Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question if less than or = to 1 script

    dim x , one, zero
    one = 1
    zero = 0
    x = inputbox (" Type any number up to find how many primes there are ")

    rem if x is less than or = to 0 then FLASE

    if x is <=1 then ' HERE IS THE ERROR
    msgbox ("error")
    else
    msgbox ("thats right")
    end if

    I dont understand why the code

    if x is <=1 is wrong..

  • #2
    Regular Coder
    Join Date
    Feb 2004
    Location
    WA
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try removing the word 'is'
    Nobody is Perfect. I am Nobody.

  • #3
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    just curious, is that VB?


    Jason

  • #4
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Jason
    just curious, is that VB?
    Looks like basic, yes. Giveaway is the dim keyword.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #5
    Regular Coder
    Join Date
    Jun 2003
    Location
    California
    Posts
    231
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, it is VBscript
    ... this and python are probably the easiest languages to learn

  • #6
    Regular Coder
    Join Date
    Feb 2003
    Location
    California
    Posts
    925
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I know a bit of python but no VB....thats why I was wondering...


    Jason


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •