npConf plugin

About this plugin

With this plugin you can work with INI files and the Windows registry, saving system resources thanks to the plugin approach. You can manage multiple INI files or Registry objects too.

You can read and write INI files values, get entire INI sections, etc. For the other hand, you can read Windows registry integer, strings and multi strings values, and many more.

The plugin is fast and save system resources, because you not need to open and write INI files for every value you read or write, but maintain one object instance with the appropiate INI file ready to use.

The same thing around the Windows registry part. You not need to open and close the Windows registry for every read/write values, but maintain one object instance with the appropiate Windows registry ready to use.

Thirparty

This plugin are imposible without the aid of this people:

Thanks a lot!

Plugin actions index

npIniCreate

Create a new Ini object instance. If you specify a local INI file and this do not exists, the plugin create it for you when you call some of the write actions, for example, npIniWriteValue. Note that this action also support for publication embedded files, however, if you use an embedded file you only can read the INI file using actions like npIniReadValue, but obviously you cannot write an embedded INI file.

The result variable store the ID of the object instance, wich you can use on others plugin actions. Also the result variable can store "False" if an error occur. In this last case In this last case the [LastError] variable contain information about the error.

↑↑

npIniDestroy

Destroy a previosly created Ini object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npIniDestroyAll

Destroy all previosly created Ini object instances.

↑↑

npIniWriteValue

Write a Ini file value on the specified section/key. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npIniReadValue

Read a Ini file value from the specified section/key. The result variable store the INI file value if exists, or the default provided value if not exists, or "False" if an error occur, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npIniDeleteKey

Delete a key from the specified section of an Ini file. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npIniReadSection

Retrieve the key names of an Ini file section onto an NeoBook array. The result variable store the names of the keys on the specified section. The result count variable store the number of items stored on the result variable, so is easy to iterate over the result array using native "Loop" statement.

If an error occur the result variable store "False", and [LastError] variable contain information about the error.

↑↑

npIniEraseSection

Erase an entire Ini file section. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npIniReadSections

Retrieve the section names of an Ini file section onto an NeoBook array. The result variable store the section names on the INI file. The result count variable store the number of items stored on the result variable, so is easy to iterate over the result array using native "Loop" statement.

If an error occur the result variable store "False", and [LastError] variable contain information about the error.

↑↑

npIniValueExists

Find if a value exists on the specified section/key of an Ini file. The result variable store "True" if the value exists, or "False" if not; also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npIniSectionExists

Find if a section exists on a Ini file. The result variable store "True" if the section exists, or "False" if not; also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npIniSectionValues

Retrieve all section values of an Ini file onto an NeoBook array. The result variable store the section values on the specified section. The result count variable store the number of items stored on the result variable, so is easy to iterate over the result array using native "Loop" statement.

If an error occur the result variable store "False", and [LastError] variable contain information about the error.

↑↑

npRegCreate

Create a new Reg object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegDestroy

Destroy a previosly created Reg object instance. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegDestroyAll

Destroy all previosly created Reg object instances.

↑↑

npRegRootKey

Set a new Windows registry root key to an Reg object instance. Specify the Windows registry root key to use. The supported Windows registry rook keys can be one of the following: HKEY_USERS, HKEY_DYN_DATA, HKEY_CLASSES_ROOT, HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE.

The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegAccessKey

Set a new Windows registry access key to an Reg object instance. You can use three diferent constants values: KEY_READ, KEY_WRITE and KEY_ALL_ACCESS. Use the first if you want only to open keys with read access. The second if you plain to write on keys. And the third if you want to get all access. Note, however, that you cannot write read only registry keys or values in any case, you can only read this kind of keys, so use KEY_READ instead of KEY_ALL_ACCESS.

The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegOpenKey

Open a registry key in order to read, write, delete values, etc. Once you open a Windows registry key, for example "Software\My Program Name", you can begi to read, write and use other plugin Windows registry keys related actions. Although it is not neccesary, is a good practice to use npRegCloseKey action after end working with the opened Windows registry key.

The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegCloseKey

Close the Windows registry key currently open. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegCreateKey

Create a non existing Windows registry key. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegDeleteKey

Delete an existing Windows registry key and all the keys and values stores in the key. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegKeyNames

Retrieve all subkey names of the current opened Windows registry key. The result variable store the names of the keys on the specified section. The result count variable store the number of items stored on the result variable, so is easy to iterate over the result array using native "Loop" statement.

If an error occur the result variable store "False", and [LastError] variable contain information about the error.

↑↑

npRegHasSubkeys

Find if the currently open Windows registry key has subkeys or not. The result variable store "True" if the key has subkeys, or "False" when not. Also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npRegKeyExists

Find if a Windows registry key exists or not. The result variable store "True" if the key exists, or "False" when not. Also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npRegValueNames

Get all value names of the currently opened Windows registry key. The result variable store the names of the key values. The result count variable store the number of items stored on the result variable, so is easy to iterate over the result array using native "Loop" statement.

If an error occur the result variable store "False", and [LastError] variable contain information about the error.

↑↑

npRegValueExists

Find if a value exists on the currently opened Windows registry key. The result variable store "True" if the value exists, or "False" when not. Also can store "False" if an error occur. In this last case the [LastError] variable contain information about the error.

↑↑

npRegWriteValue

Write a value on the currently opened Windows registry key. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegReadValue

Read a value stored on the currently opened Windows registry key. Note that the plugin can read Windows registry values of type: integer, strings and multi strings. In this last case the result variable store an Array with the strings saved on the value. You can use "GetArrayInfo" native NeoBook function to determine the number of items on the result variable. Most commonly you get a string value on the result variable, also in case of integers value types.

The result variable can also store "False" on errors, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegDeleteValue

Delete a value stored on the currently opened Windows registry key. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

npRegRenameValue

Rename a value stored on the currently opened Windows registry key. Provide the name of the value to be renamed and the new name for the value. The result variable store "True" if every is OK, or "False" if not, for example, because no instance is found with the provided ID. In this last case the [LastError] variable contain information about the error.

↑↑

Action errors subroutine

All the NeoPlugins deal with errors in the same way that NeoBook does: when the plugin found an action error the [LastError] variable store information about the error, so you can take care about this variable when execute an action.

But all the NeoPlugins also incorporate an advanced way to deal with possible action errors. You can define a subroutine named OnNeoPluginActionError in order to be executed when some action error are found and you can use this variables inside:

Note that this error handling subroutine are shared for all the NeoPlugins, so you no need to specify a subroutine for every plugin you use in your publication because the same subroutine are recognized and automagically used by every NeoPlugin. Below you can view a sample of this subroutine code:

:OnNeoPluginActionError
  AlertBox "NeoPlugin Error" "Error [LastError] in plugin: [PluginName]"
Return

Also note that the use of this NeoPlugins error handling subroutine is completelly optional. You can continue using the [LastError] variable as usual and even use the both methods at the same time.

↑↑