Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | reg.writeValue SEARCH    

  Functions
reg.createKey.ROOT
reg.deleteKey.ROOT
reg.deleteValue.ROOT
reg.read.ROOT
reg.readValue
reg.write.ROOT
reg.writeValue

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

Language: MioScript
Product: MioFactory


Syntax

reg.writeValue(productID, name, value)


Parameters

PIDproductIDOptional.
Product ID.
If set to null, the Id of the current application is used.
STRINGnameName to retrieve the value later.
STRINGvalueValue to write in the registry database.


Return value

No value is returned.


Description

Writes a value in the registry database.
This function should be used to save settings and any small data that needs to be retrieved when the application is restarted.

See also: reg.readValue.

Info: The value is written in HKEY_LOCAL_MACHINE if the user is administrator, or in HKEY_CURRENT_USER if the user is not administrator.
For more information: system.userIsAdmin.

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




MioScript Sample Code

// Read
&result = reg.readValue("{APP_ID}", "MyValue", "Not found!")
alert(&result)

// Write
reg.writeValue("{APP_ID}", "MyValue", "This is a value")

// Read again
&result = reg.readValue("{APP_ID}", "MyValue", "Not found!")
alert(&result)