$$$$ POSI NOTICE GOUNAND 14/01/31 21:15:10 7927 DATE 14/01/31 Operateur POSI Voir aussi : EXIS, DANS -------------- Description : _____________ The POSI instruction returns the index(es) of one or several items in a list. Syntax : ________ OBJECT1 = POSI OBJECT2 'DANS' OBJECT3 (OBJECT4) ('TOUS') POSSIBLE TYPES : +------------++------------++------------++------------+ | OBJECT1 || OBJECT2 || OBJECT3 || OBJECT4 | +------------++------------++------------++------------+ | ENTIER || ENTIER || LISTENTI || FLOTTANT | | LISTENTI || FLOTTANT || LISTREEL || MOT 'NOCA' | | || MOT || LISTMOTS || | | || LISTENTI || || | | || LISTREEL || || | | || LISTMOTS || || | +------------++------------++------------++------------+ => Seeks the first occurrence of an item in a list ENTIER = POSI ENTIER 'DANS' LISTENTI ; ENTIER = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) ; ENTIER = POSI MOT 'DANS' LISTMOTS ('NOCA') ; => Seeks all the occurrences of an item in a list LISTENTI = POSI ENTIER 'DANS' LISTENTI 'TOUS' ; LISTENTI = POSI FLOTTANT 'DANS' LISTREEL (FLOT1) 'TOUS' ; LISTENTI = POSI MOT 'DANS' LISTMOTS ('NOCA') 'TOUS' ; => Seeks the first occurrence of several items in a list LISTENTI = POSI LISTENTI 'DANS' LISTENTI ; LISTENTI = POSI LISTREEL 'DANS' LISTREEL (FLOT1) ; LISTENTI = POSI LISTMOTS 'DANS' LISTMOTS ('NOCA') ; Comments : __________ 1) If OBJECT2 (or one of its items) is not found in the list OBJECT3, its position is set to 0. 2) The index of the first item in OBJECT3 is 1. 3) In order to check whether two real numbers are equal, their difference (in absolute value) is compared to a small enough value. The default criterion is a RELATIVE value based on machine precision. Instead, the user can provide FLOT1 (FLOTTANT type) as an ABSOLUTE value for this criterion. 4) By default, string comparison is case sensitive, which means that upper-case and lower-case letters are not considered the same character. One can rather perform a case-insensitive search by providing the 'NOCA' keyword.
© Cast3M 2003 - All rights reserved.
Disclaimer