IBM AS/400 manual Sample Source for Debug Examples, Part, Source for Module DBGEX

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 238
Image 238
Source for Module DBGEX

Sample Source for Debug Examples

*=================================================================*

*Now the operation to modify values or call other objects.￿ *=================================================================*

*-----------------------------------------------------------------

*

*Move 'a's to the data structure DS2. After the move, the

*first occurrence of DS2 contains 10 character 'a's.

*

-----------------------------------------------------------------

*

C

MOVE

*ALL'a'

DS2

*

-----------------------------------------------------------------

*

*Change the occurrence of DS2 to 2 and move 'b's to DS2,

*making the first 10 bytes 'a's and the second 10 bytes 'b's.

 

*-----------------------------------------------------------------

 

*

C

2

OCCUR

DS2

 

C

 

MOVE

*ALL'b'

DS2

 

*-----------------------------------------------------------------

 

*

*Fld1a is an overlay field of Fld1. Since Fld1 is initialized

*to 'ABCDE', the value of Fld1a(1) is 'A'. After the

*following MOVE operation, the value of Fld1a(1) is '1'.

 

*-----------------------------------------------------------------

 

*

C

 

MOVE

'1'

Fld1a(1)

 

*-----------------------------------------------------------------

 

*

 

* Call the program RPGPGM, which is a separate program obje￿ct.

 

*-----------------------------------------------------------------

 

*

C

Plist1

PLIST

 

 

C

 

PARM

 

Parm1

C

 

CALL

'RPGPGM'

Plist1

 

*-----------------------------------------------------------------

 

*

 

* Call c_proc, which imports ExportFld from the main proced￿ure.

 

*-----------------------------------------------------------------

 

*

C

 

EVAL

SpcPtr = c_proc(SpcSiz : 'P')

 

*-----------------------------------------------------------------

 

*

*Call a local subprocedure Switch, which reverses the value of

*an indicator.

*-----------------------------------------------------------------

*

C

EVAL

*IN10 = '0'

C

CALLP

Switch(*in10)

 

 

 

Figure 105 (Part 3

of 4).

Source for Module DBGEX

214 ILE RPG for AS/400 Programmer's Guide

Page 238
Image 238
IBM manual Sample Source for Debug Examples, Part, Source for Module DBGEX, ILE RPG for AS/400 Programmers Guide