$$$$ DEBP NOTICE PASCAL 22/06/29 21:15:02 11396 DATE 22/06/29 Operateur DEBPROC Voir aussi : FINP ARGU ----------------- RESP QUIT DEBPROC PROC1 (OBJ1?TYP1 OBJ2?TYP2 .... ) ; Section : Langage Methodes FRAN========================================================== Objet : ------- L'operateur DEBPROC cree un objet de type PROCEDUR qui contient une suite d'instructions elementaires, dont la premiere est DEBPROC et la derniere est FINPROC. Commentaire : ------------- La procedure peut avoir une liste d'arguments types (OBJ1,OBJ2,...). ? peut prendre deux valeurs : * qui rend la donnee de l'argument obligatoire au moment de l'appel de la procedure, / qui la rend facultative. Les types d'objet possibles sont: 'MAILLAGE' 'AFFECTE ' 'DEFORME ' 'CHPOINT ' 'CHAMELEM' 'LISTREEL' 'RIGIDITE' 'BLOQSTRU' 'LISTENTI' 'ELEMSTRU' 'SOLUTION' 'CHARGEME' 'STRUCTUR' 'TABLE ' 'MODELE ' 'MAFFEC ' 'MSOSTU ' 'EVOLUTIO' 'IMATRI ' 'MJONCT ' 'SUPERELE' 'ATTACHE ' 'MMATRI ' 'LOGIQUE ' 'FLOTTANT' 'ENTIER ' 'MOT ' 'TEXTE ' 'LISTMOTS' 'VECTEUR ' 'VECTDOUB' 'POINT ' 'CONFIGUR' 'LISTCHPO' 'BASEMODA' 'PROCEDUR' 'BLOC ' 'MMODEL ' 'MCHAML ' 'MINTE ' 'NUAGE ' 'MATRIK ' 'LISTOBJE' Il faut bien noter qu'en presence de plusieurs arguments de Meme type seul l'ordre permet de les differencier. L'ensemble ?TYPi est facultatif. S'il est omis, DEBP essaie de recuperer un objet de n'importe quel type. Les objets de type inconnu doivent etre place a la fin de la liste des arguments a lire. Remarques : ----------- Une procedure a acces a tous les objets existants avant son appel mais ne peut pas les modifier. Tout objet dont le nom commence par ! ne sera pas initialise par un objet de meme nom defini en dehors de la procedure. Les objets crees lors de l'execution d'une procedure ne sont pas accessibles a l'exterieur de la procedure. Exemple de procedure de calcul de la fonction MODULO : ------------------------------------------------------ ANGL========================================================== Description : ----------- The DEBPROC operator creates a PROCEDUR type object which is composed of a set of elementary instructions : the first instruction is DEBPROC (beginning of procedure) and the last is FINPROC (end of procedure). Contents : ---------- This procedure can have a list of arguments with their types (OBJ1,OBJ2,...). The question mark ? may be replaced by two values : * means that the argument is necessary when the procedure is called on. / means that the argument is optional when the procedure is called on. The different possible type of objects are: 'MAILLAGE' 'AFFECTE ' 'DEFORME ' 'CHPOINT ' 'CHAMELEM' 'LISTREEL' 'RIGIDITE' 'BLOQSTRU' 'LISTENTI' 'ELEMSTRU' 'SOLUTION' 'CHARGEME' 'STRUCTUR' 'TABLE ' 'MODELE ' 'MAFFEC ' 'MSOSTU ' 'EVOLUTIO' 'IMATRI ' 'MJONCT ' 'SUPERELE' 'ATTACHE ' 'MMATRI ' 'LOGIQUE ' 'FLOTTANT' 'ENTIER ' 'MOT ' 'TEXTE ' 'LISTMOTS' 'VECTEUR ' 'VECTDOUB' 'POINT ' 'CONFIGUR' 'LISTCHPO' 'BASEMODA' 'PROCEDUR' 'BLOC ' 'MMODEL ' 'MCHAML ' 'MINTE ' 'NUAGE ' 'MATRIK ' 'LISTOBJE' Note that when several arguments have the same type, only the order enables the differentiation between them. The part ?TYPi is facultative. If omitted, DEBP attempts to read an object whatever its type. Such object must be placed at the end of the arguments list. Notes : --------- A procedure knows all the existing objects before its call but cannot modify them. Every object the name of which begins by an ! will not be initialized by another object of same name defined outside the procedure. The objects defined inside a procedure are lost outside the procedure except those listed in the FINPRO instruction. Example of a procedure which computes the MODULO function : --------------------------------------------------------- =================================================================== DEBPROC MODULO I*ENTIER J*ENTIER ; MODERR='$$$$$'; SI (J EGA 0) : MESSAGE ' ON NE PEUT FAIRE I MODULO ZERO '; RESPRO MODERR; QUITTER MODULO ; FINSI; K*ENTIER = I / J ; MOD = I - ( K * J ) ; FINPROC MOD; FRAN============================================================= Exemple d'emploi de la procedure MODULO : ----------------------------------------- ANGL============================================================= Example of use of the MODULO procedure : ---------------------------------------- ================================================================= K = 8 MODULO 3 ; SI ( K NEG 2 ) ; MESSAGE ' ERREUR DANS LA RECOPIE DE L EXEMPLE |' ; FINSI;