The ReadConfigSetting Method of the Generic ActiveX Object reads a setting from the configuration file.
ReadConfigSetting (Method of the Generic ActiveX Object) Syntax strRet = objGeneric.ReadConfigSetting(strSetting,strAppName);
Parameters
Items listed in this section indicate parameters, or attributes which can be set.
Name Possible Values Description
Default Value strSetting See: Configuration Settings A setting identifier N/A strAppName String The name of a PocketBrowser application as specified in Config.XML. When writing to a global setting this should be omitted or 'GLOBAL' used. "GLOBAL"
Return Values
Name Description strRet Returns a string which when evaluated creates an array of returned settings.
Examples
The following javascript example shows an alert with the global setting for full screen.
<script> var objGeneric = new ActiveXObject("PocketBrowser.Generic"); var Ret = objGeneric.ReadConfigSetting("FULLSCREEN"); eval("var arrRet = "+Ret); if(arrRet.length){ alert(arrRet[0]); } </script>
Copy example to clipboard The following javascript example shows an alert with the scrollbar setting for an application named "Menu".
<script> var objGeneric = new ActiveXObject("PocketBrowser.Generic"); var Ret = objGeneric.ReadConfigSetting("SCROLLBARSENABLED","Menu"); eval("var arrRet = "+Ret); if(arrRet.length){ alert(arrRet[0]); } </script>
Copy example to clipboard The following javascript example shows an alert for each preload in the application named "Menu".
<script> var objGeneric = new ActiveXObject("PocketBrowser.Generic"); var loop; var Ret = objGeneric.ReadConfigSetting("PRELOAD","Menu"); eval("var arrRet = "+Ret); for(loop=0;loop < arrRet.length;loop++){ alert(arrRet[0]); } </script>
Copy example to clipboard
Remarks
The configuration settings are accessed using symbolic names written in uppercase. These can be found in Configuration Settings under Getting Started, or just click the link below.Global settings are placed outside of the <Application> tags. Application settings are placed within the <Application> tags.
Additional Information
Supported Platforms Windows CE, Windows Mobile Persistence Runs immediately. Min. Requirements None.