GSAK (Geocaching Swiss Army Knife)
Contents - Index

CustomConfig (function)

CustomConfig(sAction,sData) : string       
 
This function allows you to Add/edit/delete fields from the Custom database system via the macro language.

sAction - The action to perform. It must be one of Add,Edit,Delete or Get
sData - The data that corresponds to your sAction

Actions:

Add - Add a field to the database. The details of the added field must be CSV data, the fields being:

1 - Field name
2 - Type (string,integer,real,Boolean,date)
3 - Scope (Global,local)
4 - Sequence
5 - Default value
6 - Control type (Standard,Large) - only applicable if type = string
7 - Control size in pixels - only applicable if type=string and control type = large
8. Sqlite expression (grid display only). For more information see this link

If sequence is not given then sequence will be set to max(sequence) + 10. If default value not given then will be set to 0 if type=Integer and 0.0 if type = real

Edit - Allows you to edit an existing field. sData is the same as per Add

Delete - Allows you to delete a field. sData should be the field name only

Get - Fetches the information for any existing field. sData should be the field name only. If not found returns an empty string, otherwise it returns a csv string as per the fields for Add above. You can use the CsvGet() function to Parse this string.

For example, to add a new custom Boolean field to all databases with a default "True" and a sequence number placing it at the end of all fields, the code would be:
 

$Result = CustomConfig("Add","NewBool,Boolean,Global,,1")

 
Note: Actions Add,Edit, and Delete are not permitted inside a transaction

 
Alpha List         Category List
Copyright 2004-2019 CWE Computer Services  
Privacy Policy Contact