IBM AS/400 manual Using Bindable APIs, Returning using ILE Bindable

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 179
Image 179
APIs

 

Using

Bindable

APIs

A subprocedure ends abnormally

and control returns

to the

calling procedur

when an unhandled exception occurs. Again, no further actions occur un procedure ends.

If the main procedure is never called (and therefore cannot end) t areas, etcetera, will not be closed. If you think this might arise you should code a termination procedure that gets called when the ends. This is especially true if the subprocedure is in a module fied on the control specification.

Returning using ILE Bindable

APIs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

You can end a procedure

normally

by

using the ILE bindable API

CEETR

However,

the

API

willall

callend

stack

entries

that

are

in

the

same

activa

up to the control boundary. When a

procedure

is

ended

using

CEETREC

normal

 

termination

processing

as

described

above

for

main

procedures

cedures.

On

the

next

call

to

the procedure, a

fresh

copy is

avai

Similarly,

you

can

end

a procedure abnormally using the ILE bindable

CEE4ABN.

The

procedure will

then

follow

abnormal

termination

as described

above.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note:

You cannot use either of these APIs in a program created wit

 

 

DFTACTGRP(*YES),

since

procedure

calls are

not

allowed

in

these

pro

 

 

dures.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Note

that

 

if

the

main

procedure

is

not

active,

or

if

there

is

no

get

closed

or

freed.

In

this case, you should enable an ILE canc

CEERTX.

If

the

cancel

handler is

in

the same module, it can close t

the

data

 

areas,

and

perform the other termination actions.

 

 

For more

information on

CEETREC

and

CEE4ABN

refer

Systemto theAPI

Refer-

 

 

ence.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Using Bindable APIs

Bindable application programming interfaces (APIs) are available to all guages. In some cases they provide additional function beyond that specific ILE language. They are also useful for mixed-language applic because they are HLL independent.

The bindable APIs provide a wide range of functions including:

¹ Activation group and control flow management

¹Storage management

¹Condition management

¹Message services

¹Source Debugger

¹Math functions

¹Call management

¹Operational descriptor access

Chapter 10. Calling Programs and Procedures155

Page 179
Image 179
IBM AS/400 manual Using Bindable APIs, Returning using ILE Bindable