|GSAK (Geocaching Swiss Army Knife)|
CustomPut(sField,sValue,[sCode]) : string
Direct Sql updates are allowed on the custom table, but that can be somewhat counter intuitive to use.
Use this function for an easy way to update custom data. This function is the is the complement to the CustomGet() function.
sField - The name of the field to update
sValue - The value to place in this field
sCode - Optional. If omitted then the code for the current cache in the grid will be used. Otherwise enter the code of the cache to be updated.
The return string is empty if the function was successful, otherwise it will contain the error message describing the problem.
If there is an error (for example a field name which is not defined in the custom table), the return string will begin with "*Error*" (without the quotes). Macro authors should really check the return value to make sure the function completed normally.
If this function is used multiple times in a macro then you should wrap the use inside a transaction, otherwise the macro will run very slowly (each use will force a discreet disk write to the database).
Although this could be done using direct update, here is the sample code to update all records in your current filter such that the contents of the custom field "MyData" is updated with the contents of "UserData2":
Alpha List Category List
Copyright 2004-2015 CWE Computer Services |