* QUERIER.H - include file for generic table-driven querying facility * By M. Asherman, Copyright (c) 1999, SpaceTime Systems * 6/14/99: introduced to minimize hard-wired arbitrary constants. * 6/19/99: adding macros for radio button values in querdest.scx. * 6/20/99: adding macros for various querier Action codes. * 11/3/99: new macros for error codes and messages. * 11/6/99: added macros for error during SELECT statement processing. * 11/7/99: capitalize 1st letter of all error msgs, for better display. * 11/8/99: adjusted message for escape from parameters dialog. * 10/1 - 10/6/01: changes related to updated error handling (quma0002): * Added new macros QUER_CLASS_DIAG & QUER_CLIBQ for use in the demo wrapper UDF. * Added macros for new error codes and messages, with more recent naming convention. * Retain obsolete macros, with suitable redefinitions, for compatibility * until these have been entirely phased out (check with Nancy and Nadya). * 10/7/01: added trace level macro, QUER_TRACE_ALL (see quma0004). * these macros are used in class Querier #define QUER_ALIAS "QUERYDF" && default meta-file alias #define QUER_FILE QUER_ALIAS && default meta-file DBF name * Action codes for 1st argument to querier() and Querier.QueryCommand #define QUER_ACRUN 'run' && Run a query - the default action #define QUER_ACCNT 'count' && return Count only - do no other output #define QUER_ACPAR 'parms' && invokes the user params dialog only (no query) #define QUER_ACPRO 'prompt' && forces prompt for destination #define QUER_ACPRR 'promptr' && prompt for destination, with Repeat #define QUER_ACBRO 'browse' && force destination to a Browse window #define QUER_ACBRN 'browsen' && force destination to a Browse NOWAIT window * macros used in UDF Querier.prg #define QUER_CLASS "Querier" && foundation class name for Querier #define QUER_CLASS_DIAG "QuerierDiag" && diagnostic Querier subclass used by querier.prg #define QUER_CLIBQ QUER_CLASS && class library for the Querier facility (quoted) #define QUER_MEMB QUER_CLASS && default member name for addition into _screen #define QUER_MVAR QUER_CLASS && reserved PUBLIC mvar name for default object * macros for radio button values in querdest.scx query destination dialog #define QUER_DTBRO 1 && Browse #define QUER_DTSCR 2 && Screen #define QUER_DTPRN 3 && Printer #define QUER_DTFIL 4 && ASCII File #define QUER_DTDBF 5 && DBF (TABLE) #define QUER_DTCUR 6 && Cursor #define QUER_DTARR 7 && reserved for Array, but not yet supported * Macros for trace levels used in property ehp_tracelevel (see quma0004, 10/7/01) #define QUER_TRACE_ALL 11 && turns on all Querier-specific tracing * New macros for error codes and messages, using naming conventions of 10/2/01 #define QUER_EC_INIT_INVMETA 21 && error # #define QUER_EM_INIT_INVMETA "Invalid metafile name argument." #define QUER_EC_INIT_ALINUSE 22 && error # #define QUER_EM_INIT_ALINUSE "Reserved alias " + QUER_ALIAS + " for query definitions metafile is in use." #define QUER_EC_OPEN_USEMETA 31 && error # #define QUER_EM_OPEN_USEMETA "Can't open Querier metafile: " #define QUER_EC_RUN_ACTTYPE 41 && error # #define QUER_EM_RUN_ACTTYPE "Action argument must be empty or of Character type." #define QUER_EC_RUN_ACTVAL 42 && error # #define QUER_EM_RUN_ACTVAL '1st arg must be ' + proper(QUER_ACRUN) + ' (the default), ' + proper(QUER_ACBRO) + ', ' + proper(QUER_ACBRN) + ', ' + proper(QUER_ACCNT) + ', ' + proper(QUER_ACPAR) + ', ' + proper(QUER_ACPRO) + ', or ' + proper(QUER_ACPRR) #define QUER_EC_RUN_IDTYPE 43 && error # #define QUER_EM_RUN_IDTYPE "Query id argument must be empty or of Character type." #define QUER_EC_RUN_NOREC 44 && error # #define QUER_EM_RUN_NOREC "No current query definitions metafile record." #define QUER_EC_RUN_DELETED 45 && error # #define QUER_EM_RUN_DELETED "Logically deleted query definitions metafile record." #define QUER_EC_RUN_NOTFOUND 46 && error # #define QUER_EM_RUN_NOTFOUND "No non-deleted query definitions metafile record with query_id = " #define QUER_EC_RUN_INITEXP 47 && error # #define QUER_EM_RUN_INITEXP "The pre-query initialization (initexp) step failed." #define QUER_EC_RUN_BADUPARMEXP 48 && error # #define QUER_EM_RUN_BADUPARMEXP "Invalid expression for invoking user parameters dialog." #define QUER_EC_RUN_PARMCANCEL 49 && error # #define QUER_EM_RUN_PARMCANCEL "User Escaped or Cancelled from the parameters dialog." #define QUER_EC_RUN_NOUSERPARMS 50 && error # #define QUER_EM_RUN_NOUSERPARMS "Query definition has no user parameters dialog." #define QUER_EC_RUN_OUTDESTEXP 51 && error # #define QUER_EM_RUN_OUTDESTEXP "Invalid expression for output destination options." #define QUER_EC_RUN_REPEATEXP 52 && error # #define QUER_EM_RUN_REPEATEXP "Invalid expression for option to repeat output." #define QUER_EC_RUN_SELECTEXP1 53 && error # #define QUER_EM_RUN_SELECTEXP1 "Invalid expression for 1st part of the SELECT statement." #define QUER_EC_RUN_SELECTEXP2 54 && error # #define QUER_EM_RUN_SELECTEXP2 "Invalid expression for 2nd part of the SELECT statement." #define QUER_EC_RUN_DELETEDEXP 55 && error # #define QUER_EM_RUN_DELETEDEXP "Unable to establish DELETED ON/OFF setting for this query." #define QUER_EC_RUN_DESTCANCEL 56 && error # #define QUER_EM_RUN_DESTCANCEL "User Escaped or cancelled from output destination dialog." #define QUER_EC_RUN_SELECTERR 57 && error # #define QUER_EM_RUN_SELECTERR "Error during SELECT statement processing." #define QUER_EC_RUN_SELECTESC 58 && error # #define QUER_EM_RUN_SELECTESC "User Escaped during query processing - output incomplete." #define QUER_EC_RUN_CLEANUP 59 && error # #define QUER_EM_RUN_CLEANUP "Post-query cleanup (cleanupexp) step failed or was invalid." * Obsolete macros to be eliminated or phased out as of 10/1/01 changes #define QUER_CLIB Querier && default options to SET CLASSLIB (unused macro) * Obsolete error code macros replaced by newer codes of 10/2/01 (see quma0002). * The old macros don't follow more recent naming conventions, * so they should be phased out by substituting newer codes. * I didn't originally realize that I could safely use more than 10 characters for macro names. * These should be deleted once Nancy & Nadya confirm that they are completely phased out. #define QUER_ERNOT 0 && error # for no error, i.e. success (unused macro) #define QUER_EMNOT "" && error msg. for no error - none (unused macro) #define QUER_ERACT QUER_EC_RUN_ACTVAL && substitute newer macro for this code #define QUER_EMACT QUER_EM_RUN_ACTVAL && substitute newer macro for this message #define QUER_ERNOP QUER_EC_OPEN_USEMETA && substitute newer macro for this code #define QUER_EMNOP QUER_EM_OPEN_USEMETA && substitute newer macro for this message #define QUER_ERNOR QUER_EC_RUN_NOREC && substitute newer macro for this code #define QUER_EMNOR QUER_EM_RUN_NOREC && substitute newer macro for this message #define QUER_ERDEL QUER_EC_RUN_DELETED && substitute newer macro for this code #define QUER_EMDEL QUER_EM_RUN_DELETED && substitute newer macro for this message #define QUER_ERQID QUER_EC_RUN_NOTFOUND && substitute newer macro for this code #define QUER_EMQID QUER_EM_RUN_NOTFOUND && substitute newer macro for this message #define QUER_ERINI QUER_EC_RUN_INITEXP && substitute newer macro for this code #define QUER_EMINI QUER_EM_RUN_INITEXP && substitute newer macro for this message #define QUER_ERPAR QUER_EC_RUN_PARMCANCEL && substitute newer macro for this code #define QUER_EMPAR QUER_EM_RUN_PARMCANCEL && substitute newer macro for this message #define QUER_ERNPA QUER_EC_RUN_NOUSERPARMS && substitute newer macro for this code #define QUER_EMNPA QUER_EM_RUN_NOUSERPARMS && substitute newer macro for this message #define QUER_ERDES QUER_EC_RUN_DESTCANCEL && substitute newer macro for this code #define QUER_EMDES QUER_EM_RUN_DESTCANCEL && substitute newer macro for this message #define QUER_ERSEL QUER_EC_RUN_SELECTERR && substitute newer macro for this code #define QUER_EMSEL QUER_EM_RUN_SELECTERR && substitute newer macro for this message #define QUER_ERESC QUER_EC_RUN_SELECTESC && substitute newer macro for this code #define QUER_EMESC QUER_EM_RUN_SELECTESC && substitute newer macro for this message #define QUER_ERFIN QUER_EC_RUN_CLEANUP && substitute newer macro for this code #define QUER_EMFIN QUER_EM_RUN_CLEANUP && substitute newer macro for this message