HK Components

================================================================================

HK_preferences

PREF_Put

Stores a preference.
The preference is identified by a unique preference code that you, the developer, assign.
You can determine if the reference is user specific or global to the application.
You can also pas a value type, this is not required for the preference storage, but will facilitate preference editing in the preferences editor, as it will then be able to use different editors for each specific preference type, also the value-type allows to pass additional information, like a value range or a choice list.

Call

PREF_Put(prefcode;value{;userspecific{;valuetype}})

Parameters

$1 -> text the code for the preference
$2 -> text the value to store as the preference
$3 -> boolean should the preference be stored as user specific, only needed in setup sequence
$4 -> text the value type of the preference and additional parameters

Example

PREF_put("smtp_server";"mail.foo.net";false;"T")

The possible values for the value type are:

ttextYou can add a choice list to the preference, by adding a list of semicolon delimited values after the type and one white space
if the first value in the list is a numeric value, it is used to determine the position of the default value in the list
Example: t 2;choice 1;choice 2;choice 3
In the preferences editor, these choices will be shown in a popup menu
bboolean
iintegerYou can add a permitted value range by adding the minimum and maximum values separated by a hyphen after the type code
Example: i 0-100
This is currently only enforced in the editor, in a future version you will be able to switch on enforcing of these rules in all circumstances.
rrealSame possibilities as with integer, obviously the value range can be float values
gpictureThe picture will be displayed in the preferences editor and in the list you will only see the picture size in bytes
xblobThis preference type cannot be edited, and in the list you will only see the size. If you store specific types of data in here, you will have to provide your own editor if needed.
pdirectory pathIn the editor you will be able to choose a directory using a default file selection dialog
ffile pathIn the editor you will be able to choose a file using a default file selection dialog
ddate
stimestampuse this to store timestamps created with the help of the HK_timestamp component
oobjectuse this to store the content of C_Object variables, as they will be stringified, you cannot store and retrieve pointers though.
htime
ffileIn the editor you will be able to choose a file using a default file selection dialog.
The file will be stored as base64 text
--------------------------------------------------------------------------------

Pricing

All current components are donationware in their compiled form, please use the donate button below to give what you think it's worth via paypal.

You can buy the sourcecode to the components. AC_Basics is free, but the source for all other components is 100 U$/€ via PayPal. You will receive the password to the archive contained in the component as soon as I receive the email from paypal confirming payment. Please make sure to call the payment button from the webpage of the desired component, so I know what you want to pay for. I can send an invoice by mail if you so require, EU corporate entities may provide a VAT ID in the message of their PayPal payments so I can deduct the VAT.

Thanks a lot

========================

Current version

0.8 - 2009.02.27
========================