IBM Version 4 manual Programming errors and refers you to, That show you how to avoid Errors, Task

Models: Version 4

1 505
Download 505 pages 30.92 Kb
Page 207
Image 207

Chapter 9. Common API Programming Errors

This chapter contains information identified as common programming errors encountered when using APIs within application programs. The chapter de provides two program examples for each common error. The first progra example is incorrectly coded and is followed by the correctly code encounter errors or problems while working with APIs, these examples ma ideas or solutions.

Note: Do not assume that an API will do things otherSystemthan APIwhat the Referencementions. If the manual does not saythatspecificallyit is allowed, it probably is not.

Figure 9-1

identifies common

API

programming errors and refers you to

that show you how to avoid the

errors.

 

 

 

 

 

 

 

Figure

9-1. Common

Programming Errors

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Task

 

 

 

 

 

 

Location

of

Example

 

 

 

 

 

 

Using the error code

paramPage-

9-2

 

 

eter

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Defining

data

structures

 

Page

9-5

 

 

 

 

 

 

 

 

Defining

receiver

variablesPage

9-10

 

 

 

 

 

 

 

 

Defining

list

entry

formatPage

9-14

 

lengths

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Using

null

pointers

with

OPMPage

9-18

 

APIs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Defining

byte

alignment

Page

9-22

 

 

 

 

 

Using offsets in user spPagece

9-27

 

 

 

 

 

 

 

 

Coding

for

new function

Page

9-36

 

 

 

 

 

 

 

 

 

 

 

 

Copyright IBM Corp. 1997

9-1

Page 207
Image 207
IBM Version 4 Programming errors and refers you to, That show you how to avoid Errors, Task, Example, Using the error code