GSAK (Geocaching Swiss Army Knife)
Contents - Index

AddNew (command)

AddNew

This command will add a new blank record in the current table. Like the GOTO command, the ADDNEW will action on the current Table. So to add a new child waypoint the code would be:

Table Active=Waypoints Scope=Parent
AddNew
$d_cCode = "XXXX"
$d_cType = "Parking Area"
$d_cLat = "-33.1456"
$d_cLon = "115.5643
.....etc

The ADDNEW command will add a record to your current table and set all the required fields to the minimum default values in order to make it a valid record. It is then your responsibility to populate/change your required fields.

Note: When using the ADDNEW command for the CORRECTED table,  it behaves similar to the corrected coordinates dialog. That is, a new corrected coordinate is added with the before and after details being the same as the cache. You would then just change the required after variables.

For example, to add a corrected coordinate that only changes the coordinates (and not the state,county) the code would be:
 

Table Active=Corrected Scope=Parent
Addnew
$d_kAfterLat = "-32.1345"
$d_kAfterLon = "115.7246"

 
Warning: There is a "Gotcha" when using AddNew for table "Caches" and a filter is set and you have speedmode set off. The "AddNew" command will add a "blank" record to the database and when speedmode is off  the database engine reflects your current filter immediately. That is, if your current filter is set such that the new record is "excluded" then the database engine forces the first record in your filter to become the current record. This can lead to "weird" looking behaviour when adding records.

Take the following simple example. You currently have a filter on "User flag = set"
All you want to do is add a new waypoint and change the code to "Way001". The following code looks like it should do the job:

AddNew
$d_Code = "Way001"

See the problem? The AddNew command adds a new blank record and the default value for the user flag is set to False. This means that the newly added record is not a record that exists in your current filter, so the current record now becomes the first record in your Filter, and it will actually be that record that gets its code changed to "Way001". This is not what you want.

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