Small Basic: Relational Operators & Strings


The Other Relational Operators

Small Basic was designed to strip out as much as it can (it isn’t called Big Complex). So the other relational operators (<, <=, >, and >=) aren’t defined for strings. If you use any these operators with non-numeric strings, the result will always be false. But being able to compare strings for equality (or inequality) will meet your basic needs.

Some programming languages let you write expressions like ("carriage" < "cat"), and they return true for this expression because "car" (the first three letters in carriage) comes before "cat" in the dictionary. Small Basic decided against this. So if your program needs you to sort strings based on their alphabetical order, you’ll need to do the sorting yourself.

Learn more about Small Basic here:

http://blogs.msdn.com/SmallBasic

 

Small and Basically yours,

   - User Ed & Majed Marji

Comments (4)

  1. Good information.

    The link is broken, remove the starting "www".

  2. Yan, okay, I updated the link. Thanks!

  3. I just made some minor readability updates.

  4. Computers Today (part 1 of 6)

    blogs.msdn.com/.../computers-today.aspx

    .....

    CS SPOTLIGHT: Girls in computer programming... why it matters!!!

    blogs.msdn.com/.../cs-spotlight-girls-in-computer-programming-why-it-matters.aspx

    ...

    Computational Thinking - Videos & Papers by Jeannette Wing

    blogs.msdn.com/.../computational-thinking-videos-amp-papers-by-jeannette-wing.aspx

Skip to main content