Quantcast
Channel: GSAK Forum
Viewing all articles
Browse latest Browse all 75330

Macro to put Msg in User Notes for Child Wpts by Kai Team - 2013-06-28

$
0
0
This should do the trick (backup your database first, so that if you don't get the expected results, you can easily restore your data):

GSK
$_sql = "update caches set User3 = (select count(ccode)from waypoints where cparent = code) WHERE (select count(ccode) from waypoints where cparent = code) > 0"
$status = Sqlite("sql",$_sql)
RESYNC

MFILTER Where=User3<>''

GOTO Position=Top
WHILE NOT($_EOL)
   IF $d_UserNote=""
       $d_UserNote="This cache has " + $d_User3 + " child waypoint(s)"
   ELSE
       $Note=Extract($d_UserNote,"$~",1)
       $Note=RegExReplace("(?m)\r\nThis Cache has.*child waypoint\(s\)",$Note,"")
       $Log=Extract($d_UserNote,"$~",2)
       $d_UserNote=$Note + $_CrLf + "This cache has " + $d_User3 + " child waypoint(s)"
   ENDIF

   GOTO Position=Next
ENDWHILE

Viewing all articles
Browse latest Browse all 75330


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>