Intermec 5055 Reference Guide

Page of 216
5055 Programmer’s Software Kit Reference Manual
4-6
You may want to take different actions depending on the type of error. You can test for
success with IM_ISSUCCESS and provide more detailed tests for a specific returned
status code. You can use the exact status code for debugging programs, but you need to
adjust the routines before you attempt to port the application. For more information, see
Chapter 5, “PSK Function Descriptions.”
Status Code Macro
Return Value
Meaning
IM_ISERROR(status)
nonzero
zero (0)
error
success or warning
IM_ISSUCCESS(status)
nonzero
zero (0)
success
error
IM_ISGOOD(status)
nonzero
zero (0)
success
warning or error
IM_ISWARN
nonzero
zero (0)
warning
success
Creating Your Own Include File
You can handle the JANUS, 6400, and Trakker Antares PSK library differences by
creating a compatibility file (compat.h) to redefine the incompatible functions. Use a
#include statement at the beginning of your program to reference this file.
The include file provides a reusable filter that you can customize for your needs. The
include file needs to rename some functions and assign specific values to other
functions.
Renaming a Function
The Trakker Antares PSK and 6400 PSK replace some C functions with Intermec
functions. For example, im_clear_screen() in the Trakker Antares PSK replaces the
Borland C clrscr() function.
Note: The JANUS PSK supports Borland C/C++ and Microsoft C/C++. The Trakker
Antares PSK and 6400 PSK only support Microsoft Visual C/C++, Professional
Edition v1.0 or v1.5x, which can create 16-bit DOS applications. For more
information, see “Microsoft C/C++ Version Requirements” in Chapter 1.
To rename the clrscr() function to work with the Trakker Antares PSK, add this line to
the compatibility file (compat2t.h):
#define clrscr() im_clear_screen()
Use the tables later in this chapter to determine the changes you need to make.
Defining Function Values
Some PSK functions do not have a clear replacement function. For these functions, you
can assign a success value or another significant value.