Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | MioScript: Conditions SEARCH    


  TechNotes
About MioEngine
About MioScript
Adding a Login feature
Admin Panel Configuration File: Account
Admin Panel Configuration File: Alerts
Admin Panel Configuration File: Channels
Admin Panel Configuration File: Servers
Admin Panel Configuration File: Software
Admin Panel Configuration File: Tasks
Admin Panel Installation Troubleshooting
Deploying an application remotely
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to debug
Installing Admin Panel on a server
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Mio File Format
MioScript: Conditions
MioScript: Events
MioScript: Functions
MioScript: Loops
MioScript: Variables and Data Types
Programming MioScript
Statistics: How to track users and actions
Where to host Mioplanet Admin Panel
XML Configuration File Format

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

  Products
All Products
MioDB
MioFactory
Mioplanet Admin Panel

TechNote
MioScript: Conditions

Language: MioScript


 MioEngine evaluates conditions to determine if a code is to be interpreted.

In the following example, an alert is prompted depending on the result of the condition:

if(&firstVar = &secondVar)
    alert("Variables are equals")
if.else
    alert("Variables are NOT equals")
if.end


For more information: if, if.else, if.end


 
Comparison Operators
 
= Equal
!= Not Equal
> Greater than
>= Greater than or equal
< Less than
<= Less than or equal

Below are some conditional expressions:

25 = 25 // 25 is equal to 25 (result is true)
25 != 25 // 25 is not equal to 25 (result is false)
25 < 25 // 25 is less to 25 (result is false)
25 <= 25 // 25 is less or equal to 25 (result is true)
25 > 25 // 25 is greater to 25 (result is false)
25 >= 25 // 25 is greater or equal to 25 (result is true)


 

Multi-conditional expressions
 
You can use && (and) and || (or) to create multi-conditional expressions.

In the following example, the alert is prompted if the two variables are equals and if third one is set to true.

if(&firstVar = &secondVar && &thirdVar = true)
    alert("Result is true!")
if.else
    alert("Result is false!")
if.end


Below are some multi-conditional expressions:

25 = 30 && 10 = 10 // 25 is equal to 25 AND 10 is equal to 10 (result is false)
25 = 30 || 10 = 10 // 25 is equal to 25 OR 10 is equal to 10 (result is true)

 

Functions Calls in Conditions
 
You can call functions in conditions as follow:

if(&firstVar = str.left(&secondVar, 10))
    ...
if.end


 

Single Line Conditions
 
A single line condition is a quick way to peform a comparison with the following syntax:

?(condition, result_if_true, result_if_false)


In the example below, the variable &result is set with Positive if the value of the variable &count is greather or egual to 0, and Negative if the value of the variable is less than 0.

&result = ?(&count < 0, "Negative", "Positive")


The following code is equivalent:

&result = ?(&count >= 0, "Positive", "Negative")


For more information: ?