Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | MioScript: Variables and Data Types 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: Variables and Data Types

Language: MioScript


 A MioScript variable can contain a strings, numbers, Boolean values or arrays.

To declare a new empty variable:


&myVariable = null


To retrieve the value stored in a variable:

&myVariable


Functions to work with variables: var...

 

Strings

 
A string is enclosed in quotes:

&myString = "Hello"


Code Sample:

event.load
    &myVar = "hello"
    alert(&myVar)
    app.close()
event.end


To concatenate (join) strings with a value stored in a variable, proceed as follow:

&myName="MioMan"
&result = "Hello, "&mioMan


To concatenate the values of two variables, use the double quote (empty string):

&myString="Hellon "
&myName="MioMan"
&result = &myString""&mioMan


 

Numbers

 
Floating points numbers are not supported by MioScript.
MioScript is supposed to work in back-office with the computer and the windows API.
As JavaScript is used to work at the end-user level (interface and data manipulation) the floating points operations are done with JavaScript.

&myNumber = 100

Mathematical calculations:

&myNumber = 100
&result = 10 + (255 * &myNumber)


The function num.compute make it possible to concatenate calculations with strings:

&myNumber = 100
&result = "The result is: "num.compute(&myNumber / 2)


Mathematical Operators

+ Addition
- Substraction
* Multiplication
/ Division
 


Boolean Values

 
Boolean values can be stored in any variable.
The keyword true is egual to 1.
The keyword false is egual to 0.

event.load
    &IamHappy = true
    alert(&IamHappy)
    app.close()
event.end

A boolean value can be used in a calculation formula.
 


Arrays

 
A variable can be used to store an array of values.
To initialize a new array:

&myArray[] = null

To store values in an array:

&myArray[] = null
&myArray[0] = "firstValue"
&myArray[1] = "secondValue"

We could also declare the array as follow:

&myArray[] = "firstValue^^secondValue"

To retreive the value of an item in the array:

&myArray[] = "firstValue^^secondValue"
alert(&myArray[1])