Screenshots     Download     Pricing     Docs     Tutorials     Resources     Contact     Forum     Search  

If Statement

The If Statement module allows you to create a condition on which the enclosed modules will get executed or not. This is similar to the conditional statements seen in the VBScript and other scripting languages. Using the interface you can compare RoboRealm variables against other variables or values to determine if the following modules should be executed or not.

Interface

Instructions

1. Variable - Specify the variable to test using the dropdown menus. Select [new] to create a new variable that is not already in the list.

2. Comparison - Select the appropriate comparison.

equals - true if the variable and value are equal.

not equals - true if the variable and value are not equal

greater than - true if the variable is greater than the value. For numbers this is a direct comparison, for text the order is alphabetical.

greater or equal to - true if the variable is greater than or equal to the value.

less than - true if the variable is less than the value. For numbers this is a direct comparison, for text the order is alphabetical.

less or equal to - true if the variable is less than or equal to the value.

contains - true for text comparisons where the variable has the specified value as a sub component (i.e. word) within in. For example, "The dog jumped over the fence" contains "dog".

does not contain - true if for text comparisons where the variable does NOT contain the specified value. For example, "The dog jumped over the fence" does NOT contain "cat".

is within - true for text comparisons where the variable is within (present in) the value. For example, "dog" is within "The dog jumped over the fence". This is logically the opposite of the "contains" comparison.

is not within - true for text comparisons where the variable is NOT within (absent from) the value. For example, "cat" is not within "The dog jumped over the fence". This is logically the opposite of the "does not contain" comparison.

starts with - true for text comparisons where the variable starts with the specified value. For example, "The dog jumped over the fence" starts with "The dog".

not starts with - true for text comparisons where the variable does not start with the specified value. For example, "The dog jumped over the fence" does not start with "The cat".

ends with - true for text comparisons where the variable ends with the specified value. For example, "The dog jumped over the fence" ends with "fence".

not ends with - true for text comparisons where the variable does not end with the specified value. For example, "The dog jumped over the fence" does not end with "wall".

is null - true if the variable either contains zero (for numbers) or an empty string "" for text.

is not null - true if the variable either contains a non-zero value or has some text even if a single letter.

is a multiple of - true for numeric comparisons where the variable is a multiple of the specified value (aka modulus). For example, 4 is a multiple of 2 since 4 mod 2 or 4 % 2 is zero.

is not a multiple of - true for numeric comparisons where the variable is not a multiple of the specified value (aka modulus). For example, 5 is not a multiple of 2 since 5 mod 2 or 5 % 2 is 1.

3. Type - Select the comparison type. The comparison type helps specify how the comparison is performed. For example, if two strings "100" and "2" are compared as text "2" will be greater than "100", but if compared as integers then "100" will be greater than "2".

4. Value - Specify the value to compare to. For variables use the dropdown list. For other static values such as numbers or strings simply type in the value. You can also use the expressions in the value field to test variables based on mathematical expressions of other variables/numbers.

5. Join - Specify the type of join to perform on multiple conditions

6. Latch - Select the Latch Condition if you only want the If Statement to trigger when the condition transitions from false to true, i.e. once true, the condition will not trigger until the condition evaluates to false and then true again.

See Also


Set Variable


 New Post 
If_Statement Related Forum PostsLast postPostsViews
Vb script to determine ball in region
I need help to determine ball position in 4 quadrant, which is quadrant 1 to quadrant 4 by using the line as  i attach...
1 year 2 174
Speak within an if Statement
Hi, I seem to have a problem with an If statement. When I place Speak within the If statement , no speech is heard...
1 year 2 429
Constant Variable
I'm new to RoboRealm and I'm trying to make a program to detect certain objects. I have filters that filter out everything but t...
1 year 2 539
Bug in multiline cut and if statement
If you try to cut a complete if statement till its end with a multiline cut, things get messed up pretty bad....
3 years 2 736
Bug with double if creation
Ich you create two if statement directly in sequence, mark the second one and move it upwards, in walks into the first if. OK. T...
3 years 2 638
Testing an integer array for emptyness
Hi, I need to test in a robo file if there exists a Harris_Corner, how can I achieve it? Does "if H...
3 years 2 798
RGB Filter
Is there a way to turn one RGB filter on and turn another off?...
4 years 4 1114
Move if-statements more easily.
I've found it very difficult to move if and endif statements around. If you accidentally move an endif statement above its if s...
4 years 2 764
To insert a module in the Pipeline
Hi to the users of this forum, I have a question to do, and I hope that someone has a solution.
4 years 5 1471
Audio
Hi. I have a problem with the audio. For example, when I include a format. Wav or beep in a state i...
4 years 4 1161
Display data from Pic
Is it possible to display the data from the Pic. I can see the PIC data I have got it to send in t...
5 years 6 1412
compairing variables
How would i compair the the COLOR_SAMPLE_NEAREST Variable from the sample color function to a preset variable in an if command?...
5 years 4 1076
Timer and If Statement Module
For some reason I cannot for the life of me get the If Statement Module to work with a "timer" value.  All I'm tryi...
5 years 2 963
about using many modules
looking at using a few modules and making robo files how do  i use like follow red object,then irobot ro...
6 years 4 1423
Else block disabled
Hi everyody, I'm using an If statement in my .robo, and I need an Else block with it. But no matte...
7 years 2 1791
interface
hello....i want to ask something that i'm not very clear, i want to do another GUI interface using VC++. it will...
8 years 6 1551
if statement multiple conditions
Hi, In my program I introduced an if_statement, which includes more than one condition (3-4). Apparently, the if_s...
8 years 2 2865




© 2005 - 2017 RoboRealm. All Rights Reserved. | Contact | Privacy | Disclaimer | Link to Us |