/* * Concordance Programming Language * Dataflight Software, Inc. * 2337 Roscomare Road, Suite 11 * Los Angeles, CA 90077 * * MakeTagsReplicate.cpl * * Synopsis: Program to fix a bug in replication. * Tags created before replication is enabled * are not replicating in Concordance V6.52 * and earlier. This program cycles through * all tags, untags and retags the document * AFTER replication has been enabled, making * the tags replicate at the next synchronization. * */ int isWindows = 1; main() { int db, bt, i, rc; char string[256]; text szText; if (db.documents < 0) return(Message("Please open a database first.",TRUE)); if ((bt = btopen(string = db.database+".TAG")) == EOF) return(Message("Couldn't open "+string,TRUE)); for(i = btfirst(bt, string, rc); i == 0; i = btgt(bt, szText, string, rc)) { szText = string; Message("Processing: "+szText, FALSE); tagquery(db, szText); cycle(db) { tag(db, 0, szText); tag(db, 1, szText); } } btclose(bt); return; } /* main() */ RGB(char red, grn, blu) { return(((blu & 255) * 65536) | ((grn & 255) * 256) | (red & 255)); } /**************************************************************** * Name: Message * * Synopsis: Displays error message and waits for key. * ****************************************************************/ Message(text message; int wait) { text screen; int key; int fg, bk, tr, tc; if (wait) { eval('messageBox(0, message, "Concordance", 0);', key); if (key == 0) return; } tr = 8; tc = 13; bk = RGB(255,0,255); fg = isWindows ? RGB(160,0,160) : MenuColor_; cursoroff(); if (wait) screen = save(tr, tc, tr + 3, tc + 56); box(tr , tc , tr + 2, tc + 54,"3U", fg, bk); puts(tr + 1,tc + 1,pad(message,'C',53), isWindows ? RGB(255,255,255) : fg,bk); if (wait) { while(keypress()) getkey(); key = getkey(); restore(tr,tc,screen); } return(asc(upper(chr(key)))); } /* Message() */ /**************************************************************** * Global Variable Declarations and Initialization * ****************************************************************/ /* findfirst() file attributes. _A_NORMAL 00 Normal file - No read/write restrictions _A_RDONLY 01 Read only file _A_HIDDEN 02 Hidden file _A_SYSTEM 04 System file _A_VOLID 08 Volume ID file _A_SUBDIR 16 Subdirectory _A_ARCH 32 Archive file edit() mode attributes. A // Alpha only mode. U // Upper case conversion. N // Numeric only mode. Y // Y mode for dates. M // M mode for dates. D // D mode for dates. C // Cut and paste mode. S // Scroll field left and right, no wordwrapping. E // Return on [Enter], no CR in data. T // Always edit from the top. B // Always edit from the bottom. @ // Display only this field. ! // Return when this field is entered, don't edit. N:99.99 */ int CTRLPGUP = 33792, F11 = 34048, F12 = 34304, EOF = -1; short LEFT = 19200, RIGHT = 19712, UP = 18432, DOWN = 20480, HOME = 18176, END = 20224, PGUP = 18688, PGDN = 20736, CTRLPGDN = 30208, F1 = 15104, F2 = 15360, F3 = 15616, F4 = 15872, F5 = 16128, F6 = 16384, F7 = 16640, F8 = 16896, F9 = 17152, F10 = 17408; char ESC = 27, CTRLP = 16, FALSE = 0, TRUE = 1, CR = 13, LF = 10; /* Standard dialog button return values. */ int IDOK = 1; int IDCANCEL = 2; int IDABORT = 3; int IDRETRY = 4; int IDIGNORE = 5; int IDYES = 6; int IDNO = 7; /* MessageBox() display options. */ int MB_OK = 0; int MB_OKCANCEL = 1; int MB_ABORTRETRYIGNORE = 2; int MB_YESNOCANCEL = 3; int MB_YESNO = 4; int MB_RETRYCANCEL = 5; int MB_TYPEMASK = 15; int MB_ICONHAND = 16; int MB_ICONQUESTION = 32; int MB_ICONEXCLAMATION = 48; int MB_ICONASTERISK = 64; int MB_ICONMASK = 240; int MB_ICONINFORMATION = MB_ICONASTERISK; int MB_ICONSTOP = MB_ICONHAND; int MB_DEFBUTTON1 = 0; int MB_DEFBUTTON2 = 256; int MB_DEFBUTTON3 = 512; int MB_DEFMASK = 3840; int MB_APPLMODAL = 0; int MB_SYSTEMMODAL = 4096; int MB_TASKMODAL = 8192; int MB_NOFOCUS = 32768;