Shiny Language Reference
Language Reference > Registry Functions
readprofilestring
string readprofilestring(string Value, string Default);
Synonyms:
string rpstring(string Value, string Default);
Reads a profile string from the registry
READPROFILESTRING returns the contents of the specified string value in the registry. When a new SSE is loaded by Brass, a registry key is created for it under HKCU\Software\32Bits\Brass\Shiny<plugin_filename>. This key is used to store the position, size and configuration of the display panel as well as associated settings that all plugins have access to (for example, hotkeys). Plugins may read values from and write values to this registry key to manage their configuration and internal settings. The standard registry profile functions are not designed for general-purpose registry access. Instead they are intended to allow plugins to store configuration and ensure that any such configuration stored is unique to the plugin instance. This is why the registry functions do not allow the selection of registry keys. Refer to GETSELFNAME for more information on unique instances.
READPROFILESTRING must only be used to retrieve data from registry values specified as strings.
This statement is only valid in the RegRead handler
Parameters
Value
The name of the registry value to read
Default
If the value doesn't exist (for example, this is the first time the plugin has been loaded), the value specified here is used as the return value for the statement. This ensures READPROFILESTRING always returns a sensible value without requiring a separate check to see if the registry value exists.
Return Value
The string data read from the value, or the default value if the registry value doesn't exist.
Example Code
// Get the contents of the Hiscore value from the registry
string Hiscore = readprofilestring("Hiscore", "No scores yet!");