/* ** Concordance Programming Language WINVZN program ** ** Copyright (c) 1995 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: ** ** Copyright (c) 1995 YOUR NAME. ALL RIGHTS RESERVED. ** Portions copyright (c) 1995 Dataflight Software, Inc. ** ** INSTRUCTIONS: In Settings section of the appropriate database.INI file, ** indicate the path to WinVzn.CPL. You'll need to use your own path information, ** but here's an example of what the statement might look like; ** ** [Settings] ** ViewerCPL=F:\Apps\Legal\WinVzn\WinVzn.CPL ** ** Concordance v6.10 & later support the following method as well; ** ** [Settings] ** Viewer=Clipboard ** ** ** ** */ /**************************************************************** * Name: main * Synopsis: Start point of program ****************************************************************/ int isWindows; int darkPurple, lightPurple, black; main() { int db, i, imageField; char string[128]; string = ver(); isWindows = match( upper( string ),"WINDOWS" ,1); if( isWindows ) { darkPurple = RGB(160,0,160); lightPurple = RGB(255,0,255); black = RGB(0,0,0); } else { darkPurple = MenuColor_; black = MenuColor_; } /* Must start with an opened database. */ if( db.documents < 0 ) return( Message("Please open your Concordance database first.",TRUE)); /* Look for an image field. */ for( i = 1; i <= db.fields; i = i + 1 ) if( db.image[i] ) { imageField = i; break; } cursoroff(); if( imageField == 0 ) return( Message("Couldn't find an image field in "+db.database,TRUE) ); string = db.name[imageField]; cut( db->string ); } /**************************************************************** * Name: Message * * Synopsis: Displays error message and waits for key. * ****************************************************************/ Message(text message; int wait) { text screen; int key; cursoroff(); if( wait ) screen = save(4,12,9,70); /* If this isn't the windows version of Concordance, */ /* the box() function will produce a drop shadowed box */ /* ignoring the background color parameters. */ /* Draw a large dropped box with a raised box */ /* displayed in its center. */ box(4,12,8,70,"3D", darkPurple,lightPurple); box(5,13,7,69,"3U", darkPurple,lightPurple); puts(6,14,pad(message,'C',53),black,lightPurple); while(keypress()) getkey(); if (wait) { key = getkey(); restore(4,12,screen); } return(asc(upper(chr(key)))); } /* Message() */ /**************************************************************** * Global Variable Declarations and Initialization * ****************************************************************/ 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;