Products Downloads


French version


 

 

ADELIA

VADELIA

SADELIA

WADELIA

MADELIA

(I/B)

(I/B) (C/S)

(B) (S)

(I/B) (C/S)

(I) (C/S)

 

Warning: In the case of ADELIA programs, this instruction is not compatible with C generator.

 

Section for use

All

 

Syntax

CHANGE_ELT ListName Option

 

Option

*SELECT | *UNSELECT | None

 

Description

This instruction modifies the current element in the list ListName, taking the new values of the variables in it.

 

The option Option can be used to select (*SELECT) or unselect (*UNSELECT) the current element. It sets the modified element's "Changed" status to TRUE.

 

Warning: This option (*SELECT or *UNSELECT) cannot be used with ADELIA programs.

 

Once this instruction has been executed, the modified element becomes the current element.

 

The predefined function &CODE_LST on the list indicates whether the modification was successful.

 

Below are the possible values:

 

Value

 

*INVALID_OP

The modification failed (current element is invalid).

*NORMAL

The modification was successful.

 

Example

Adelia context:

DECL LIST ITEM_LST WITEM WITEM_PRICE

 

READ_F_ELT ITEM_LST

DO_WHILE &LST_CODE(ITEM_LST) = *NORMAL

WITEM_PRICE = WITEM_PRICE*1,1

CHANGE_ELT ITEM_LST

READ_NX_ELT ITEM_LST

REDO

 

Visual Adelia context:

CHANGE_ELT List1

 

CHANGE_ELT List1 *SELECT

 

CHANGE_ELT List2 *UNSELECT

 

* The following program seeks elements in the graphical list ITEM_LST,
* modifies the unit price if it is higher than 1,500 and selects from the list the lines which have been modified

READ_LST ITEM_LST:LIST

IF   ZIITEM_PRICE > 1,500

ZIITEM_PRICE = ZIITEM_PRICE * 0.8

CHANGE_ELT ITEM_LST:LIST *SELECT

END

END_READ_LST

 

Other example:

 

* read loop on a graphic list (VADELIA or WADELIA program) to take into account all the selected lines for updating

READ_LST LST_EMPLOYEE:LIST *SELECT

   *

   P_ACTION_CODE = 'UP'

   P_EMPL_CODE = *BLANK   

   P_EMPL_CODE = ZZ_EMPL_CODE

   *

   CALL UPD_EMPLOYEE P_EMPL_CODE P_ACTION_CODE

   IF P_ACTION_CODE = 'OK'

      READ_SQL EMPLOYEE *COND(EM_EMPL_CODE = :P_EMPL_CODE)

      PRESENT EMPLOYEE

      CHANGE_ELT LST_EMPLOYEE:LIST *DESELECT

   END

   *

END_READ_LST

 

↑ Top of page


  • Aucune étiquette