You are here: User Exits Overview > User Exits
User Exits
User exits give you an easy way to add custom capabilities
to ScanTools software. You can initiate actions during scanning that cannot
be caused using ScanTools software alone. This gives you greater flexibility
to tailor ScanTools software to your applications. Specifically, user
exits can alter the scanning operations, post-scan editing, and/or scoring
operations.
- Request scanner actions
that alter the normal sequence of events in the scanning cycle
- Modify buffers used
by the scanner to communicate scanned information
- Clip images (For
Image Scanner Implementation Only) from scanned sheets in a variety
of formats and pixel depth.
- Scale images of scanned
sheets from iNSIGHT 20, iNSIGHT 30, and iNSIGHT 2/4 scanners to
match the iNSIGHT 70/150 or 5000i scanner resolution of your choice.
- Modify the data to
be edited and the edit error prompt before these are be presented to the
user
- Do special edit checks
at the record or field level both before and after the data is presented
to and edited by the user
- Force a field to be
skipped so a user will not see the field and optionally place data in
the field (possibly from a popup
menu of choices)
- Do verification at
the field or record level of the data, after it is edited, and force
the field or record to be re-edited upon failure of this verification
- Modify the data to
be scored prior to scoring
- Analyze the data or
other information and cause the data record to not be scored
- Capture the scores
generated during scoring
- Analyze the scores
or other information and cause the scored record to not be written to
disk
For any User Exit work, you must have ScanTools software
and you must use a C/C++ compiler that can create Windows Dynamic Link
Libraries (DLLs). Scantron has developed and tested user exits using the
following development platforms:
- Microsoft Visual Studio
.NET 2010 - Microsoft Visual C++
- Microsoft Visual Studio
.NET 2008 - Microsoft Visual C++
- Microsoft Visual Studio
.NET 2005 - Microsoft Visual C++
NOTE:
Languages other than C/C++ are not supported in ScanTools software. User exits that were written for Image ScanTools version 4.2 or
earlier or ScanTools II version 1.1 can not run with ScanTools Plus version
6.0 or later. See Rebuilding User
Exits.
NOTE: User exits are unmanaged code.
During ScanTools installation, you must select one (or
more) of the User Exit Shell Module components to receive the
required source files and Microsoft wizard files that are used for user
exit development.
User Exit access within ScanTools software divides scanning
and editing operations into distinct stages. Each of these processing
stages has a User Exit function call assigned to it. These functions are
pre-defined in the user exit shell code that is provided.
The user exit programmer
will not be required to create the function calls applicable to these
exit points. The programmer will only have to insert code relevant to
the desired operation within these pre-defined user exit functions.
The
user exits are listed below, including the name, number, function call,
and brief description. More details are available in other topics, listed
at the end of this topic.
INIT 1
|
OnExitPointInit
|
Called one time per scan batchbeforeactual scanning of forms.
Used to initialize batch variables, open files, connect to databases,
etc.
|
ACQUIRE 2
|
OnExitPointAcquire
|
Called one time per sheetafter the sheet is scanned but
before form ID is performed.
|
DOCCHK 3
|
OnExitPointDocChk
|
Called one time per sheetafter the sheet is identified
but before grid resolution has
been performed.
|
RESOLVE 4
|
OnExitPointResolve
|
Called one time per sheetafter grid resolution for the sheet
is performed but before
data is examined for edit failures.
|
PRESCORE 7
|
OnExitPointPreScore
|
Called one time per document, on the last
sheet,after edit examination
for the sheet is performed but before
transport string is printed on the last sheet of the document and sheet
is stacked. This function is only called
if scan-time
scoring is enabled.
|
XPRINT 5
|
OnExitPointXPrint
|
Called one time per sheetafter edit examination for the sheet
is performed but before
transport string is printed on the sheet and sheet is stacked. This is
the function call to use for any operation that is to be applied to every
sheet scanned without error.
|
DOCDONE 6
|
OnExitPointDocDone
|
Called one time per documentafter all component sheets of the document
are processed but before
the data record for this document is written to disk. This is the
function call to use for any operation that is to be applied to every
whole document scanned without individual regard for its component sheets.
|
PRECONVERTHDR 8
|
OnExitPointPreConvertHeader
|
If scan-time conversion is enabled and conversion format is SPSS (Windows)
or Delimited ASCII (.DLM, .CSV, or .TXT), this function is called one time
at the beginning of the batch after the first document is accepted. This
call occurs prior to the creation of the conversion header.
|
POSTCONVERTHDR 9
|
OnExitPointPostConvertHeader
|
If scan-time
conversion is enabled and conversion format is SPSS (Windows), this function
is called one time after the creation
of the conversion header but prior to the writing of the header to disk.
|
PRECONVERT 10
|
OnExitPointPreConvert
|
If scan-time conversion is enabled, this function is called one time per documentafter
the document is accepted. This call occurs prior to the creation
of the conversion record.
|
POSTCONVERT 11
|
OnExitPointPostConvert
|
If scan-time conversion is enabled, this function is called one time per documentafter
the creation of the conversion record but prior to the writing of the
record to disk.
|
PRECORRECT 14
|
OnExitPointPreOnlineEditCorrect
|
If online Edit correction is enabled, called just before a record is presented to the
Online Editor. This happens asynchronously to the scanning operation and
is triggered by a record being queued for Online Edit or by a previously
Online Edit record being completed. For this reason, the PRECORRECT user
exit point does not appear in the following flow chart or scanning cycle
discussion.
|
DOCLIP 15
|
OnExitPointDoClip
|
For Image Scanner Implementation OnlyCalled
one time per sheet after the transport
print string is printed on the sheet and the sheet is stacked.
This is used to do image clipping on the iNSIGHT
2/4 scanner with imaging while the next sheet is being fed, to improve
performance. This User Exit point should be used to do clipping for any
User Exit which is to be used on both an iNSIGHT 70/150, 5000i,
iNSIGHT 20, or iNSIGHT 30 scanner and an iNSIGHT 2/4 scanner.
The DOCLIP user exit can be used with iNSIGHT
70/150 and 5000i scanners but is not required.
|
ONERROR 98
|
OnExitPointOnError
|
Called when a scanning error occurs just before
the Scanning Error Dialog appears. A scanned sheet can be ignored
and treated as if it had never been scanned by returning the IGNORESHEET
request. An unscannable sheet can be skipped and treated as if it was
scanned successfully by returning the IGNOREERROR request, except in the
case of a User Exit Stop, Document Sequence Error, or Key Item Count Error.
Any attempt to skip an unscannable sheet with these errors will be ignored.
|
CLEANUP 99
|
OnExitPointCleanUp
|
Called one time at the end of the scanning run. All sheets
of the batch are cleared from the bed and the data files are
closed.
|
Edit Setup
|
EditUserExitSetup
|
Called at the start of each
editing session to allow the Edit User Exit shell code to capture information
about the edit session that can be made available to the Edit User Exit.
The user should only modify this Edit User Exit code to change the title
on the edit screen or to chain to an additional user exit.
|
Edit Batch Entry
|
EditAtBatchEntry
|
Called at the start of each
editing session to allow the user to setup/initialize any variables or
resources to be used by the Edit User Exit during the edit session.
|
Edit Document Entry
|
EditAtDocumentEntry
|
Called one time per edit failing document after an edit failing document
is identified but before
any data appears to the user. Used to do pre-editing analysis
of the entire output record to be edited. Also used to allow the Edit
User Exit to modify any or all of the document’s data prior to editing.
|
Edit Field Entry
|
EditAtFieldEntry
|
Called one time per edit failing field after
an edit failing field is found, but before
the data or edit failure prompt is presented to the user. Used
to modify the field’s data or edit failure prompt. Also used to do special
pre-edit verification of the field’s data and signal the edit code to
not present this field to the user (skip the field), if this verification
indicates it doesn’t need to be edited.
|
Edit Field Exit
|
EditAtFieldExit
|
Called one time per edit failing fieldafter the user has seen
the field or the field entry user exit has skipped the field but before the field’s edited data is
entered into the document’s data record in memory.
Used to carry out special post-edit verification of the field’s edited
data and force the field to be re-edited, if the field fails this verification.
Also used to force data into the field after it is edited (for example
a translation of the data entered by the user).
|
Edit Document Exit
|
EditAtDocumentExit
|
Called one time per edit
failing documentafter
the user has seen all the edit failing fields on the document which were
not skipped by the field entry user exit but before
the document’s edited data is sent saved to the data file on disk. Used to carry out special verification
of all edited data for the document and force the document to be re-edited,
if the document fails this verification.
|
Edit Batch Exit
|
EditAtBatchExit
|
Called at the end of each editing session to allow the
Edit User Exit to do any necessary cleanup including freeing any resources
allocated during batch entry.
|
Score Setup
|
ScoreUserExitSetup
|
Called at the start of each
scoring session to allow the Score User Exit shell code to capture information
about the score session that can be made available to the Score User Exit.
The user should only modify this Score User Exit code to chain to an additional
Score User Exit.
|
Score Initialize
|
ScoreInit
|
Called at the start of each
scoring session to allow the user to setup/initialize any variables or
resources to be used by the Score User Exit during the score session.
|
Score Record Entry
|
ScoreRecordEntry
|
Called after the data record
to be scored is loaded but before the record is scored. Used
to change the data prior to scoring or to analyze the data or other information
and if desired, cause the record to not be scored.
|
Score Record Exit
|
ScoreRecordExit
|
Called after the data record
is scored but before it is written to the disk. Used to capture
the scores or to analyze the scores or other information and if desired,
cause the scored record to not be written to the disk.
|
Score Cleanup
|
ScoreCleanup
|
Called at the end of each scoring session to allow the Score User Exit
to do any necessary cleanup including freeing any resources allocated
during score initialize
|
Helper Functions
In addition, the ScanTools user exit library provides
a number of Helper Functions. These
are functions that are either common to many user exits or that would
require an in-depth understanding of the internal ScanTools data structures
to write.
User Exits and Grayboxes
CAUTION: User
exits are not compatible with applications that contain grayboxes that
use absolute Units of Measurement (.001 in, .01 mm, or Hybrid). See Grid Measurement dialog box - Unit of Measurement and Grid
Measurement dialog box - Special Cases.