WriteUserSetting Method

PocketBrowser 3.x API

The WriteUserSetting Method of the Generic ActiveX Object writes a custom setting to the configuration file.

WriteUserSetting (Method of the Generic ActiveX Object) Syntax
bRetVal = objGeneric.WriteUserSetting(strSetting,strValue);

ParametersW Toggle Parameters

Items listed in this section indicate parameters, or attributes which can be set.

Name Possible Values Description
Default Value
strSetting String The name of the setting N/A
strValue String Value to set. N/A

axReturns Toggle Return Values

Name Description
bRetVal Returns a boolean value. A return value of "true" indicates success.

Examples Toggle Examples

The following javascript writes the string "red" to a setting "BgColor".

<script>
var objGeneric = new ActiveXObject("PocketBrowser.Generic");
var Ret = objGeneric.WriteUserSetting("BgColor","red");
if(Ret=='true'){
alert("Custom setting saved");
}
</script>
Copy example to clipboard Copy example to clipboard

Remarks Toggle Remarks

If the setting does not exist, it will be created.

The data is stored in the configuration file under <USERDATA>


Info Toggle Additional Information

Supported Platforms Windows CE, Windows Mobile
Persistence Runs immediately.
Min. Requirements None.