Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | var.dec SEARCH    

  Functions
var.array.clear
var.array.count
var.array.countEx
var.array.getString
var.array.insert
var.array.remove
var.array.sort
var.count
var.dec
var.exists
var.free
var.get
var.getIndex
var.getName
var.inc
var.set

  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...

Function
var.dec

Language: MioScript
Product: MioFactory


Syntax

var.dec(VariableName, Step, Minimim, RestartAt)


Parameters

VARIABLEVariableNameName of the variable.
INTStepOptional.
Number to subtract from the number stored in the variable.
Default value is 1.
INTMinimimOptional.
Minimum value the result can be.
INTRestartAtOptional.
Value to store in the variable when the minimum is reached.


Return value

Number.



Description

This function decrements the value of a variable.




MioScript Sample Code

&number = 10
var.array.clear(myArray)

for(&ptr, 0, 16)
    var.dec(&number, 1, 0, 10)
    &myArray[&ptr] = &number
for.next

alert(&myArray[])

// Result:
// 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5