Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | mio.run SEARCH    

  Functions
mio.code.compile
mio.code.save
mio.create
mio.currentHeader.get
mio.currentHeader.set
mio.extract
mio.header.get
mio.rebuild
mio.run

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

Language: MioScript
Product: MioFactory


Syntax

mio.run(productID, mioFile, pathToMioEngine)


Parameters

PIDproductIDProduct ID.
Ignored is the pathToMioEngine is specified.
STRINGmioFileOptional.
Mio file to run.
If both the path to the file and pathToMioEngine are not specified, the installation folder of the specified application is used.
STRINGpathToMioEngineOptional.
Path to MioEngine, or full exe filename.
If not specified, the installation folder of the specified application is used.


Return value

No value is returned.


Description

Executes a .mio file using the version of MioEngine installed with the application specified by the product ID.

The name of the MioEngine exe file is the product name with .exe extension. The product name is found in the registry database (key productName).

If your application is not installed, the mioEngine running the current application is used to run the mio file.

This function can be called from JavaScript with mio_run.

Controlling the task (process) name of your application


The task or process name of a windows application is set by the name of the exe file.
You can create a copy of MioEngine and run a mio file using this copy to control the name of the process.

In the following example, the current MioEngine, running the current application, is copied and used to run a mio file.
The process name of the application, as visible in Windows task manager, will be MyApp:


disk.file.copy(system.mioEngine.filename(), path.rsc("MyApp.exe"))
mio.run(null, path.rsc("myMioFile.mio"), path.rsc("MyApp.exe"))




Note: This function is defined in the library klib.k and is linked automatically.




MioScript Sample Code

mio.run("{APP_ID}", "myMio.mio")