/* ** Concordance Programming Language ** ** Copyright (c) 2002 Dataflight Software, Inc. ** ALL RIGHTS RESERVED. ** 2337 Roscomare Road, Suite 11 ** Bel Air, CA 90077 ** ** Unauthorized distribution, adaptation or use may be ** subject to civil and criminal penalties. ** ** You may incorporate this program into your own programs ** ONLY if you incorporate the following copyright notice: ** ** Tags4Reports.cpl */ /*****************************************************/ /* Function: Main */ /* Purpose : Entry point for all programs */ /*****************************************************/ main() { int i; i = messageBox('This program allows you to add tags to a report.' + newline()+ 'It adds a new command to display the tags, GetTags().' + newline() + 'GetTags() requires one parameter, the delimiter to place' + newline() + 'between tags, for instance a comma: GetTags(", "), or a' + newline() + 'blank line: GetTags(newline())' + newline() + newline() + 'Click OK use the report writer now', program(), MB_ICONINFORMATION | MB_OKCANCEL); if (i == IDOK) reportfs(0); } /**************************************************************** * Name: GetTags * * Synopsis: Main function to list a document's tags. * ****************************************************************/ GetTags(text pszDelimiter) { int btTag, nData, i; char szKey[200]; text pszTags; int db; /* Cycle through the database */ if ((btTag = btopen(db.database + ".TAG")) <> EOF) { /* Cycle through the list */ for (i = btfirst(btTag , szKey, nData); i == 0; i = btgt(btTag , szKey, szKey, nData)) { /* If it is tagged then add it to the list. */ if (istagged(db, szKey)) { pszTags= pszTags + szKey + pszDelimiter; } szKey= szKey+ " "; } btclose(btTag ); } return(pszTags); }