A list of products available on this site
Documentation for XtraMania's xtras
Prices and links to the online store
Xtras, PDFs, samples
Have a question? Ask us!
Contacts
Logo. www.xtramaina.com  
Home Search E-mail
VbScriptXtra Samples/Registry

ActiveCompanionSet xtras for Macromedia Director

Storing User's Preferences in System Registry

VbScriptXtra provides free Registry key wrapper that allows handling operations with System Registry. The code below creates a key at the appropriate location in Registry and then puts there a couple of values.

vb = xtra("VbScriptXtra")

-- Create wrapper
key = vb.CreateWrapper( #RegistryKey )

-- Open it
key.Open( "HKEY_CURRENT_USER", "Software\<YourCompanyName>\<YourProjectName>" )
if key.Failed then exit

key["Settings name"] = 123
key["Another name"] = "Some useful info"

Using User's Preferences in System Registry

Later you may read the data stored in Registry:

vb = xtra("VbScriptXtra")

-- Create wrapper
key = vb.CreateWrapper( #RegistryKey )

-- Open it
key.Open( "HKEY_CURRENT_USER", "Software\<YourCompanyName>\<YourProjectName>", #KEY_READ )
if key.Failed then exit

if key["Settings name"] = 123 then
  alert key["Settings name"]
end if

member("SomeMember").text = string(key["Another name"])

Site homeSearchContact author © Eugene Shoustrov. www.xtramania.com