Programme (ou module) de confirmation générique
**FREE
// Programme: CONFIRME - Confirmation générique
// Description: Affiche une question et retourne O ou N
// Paramètres: Message (50 car), Réponse (1 car)
Ctl-Opt DftActGrp(*No) ActGrp(*Caller) Option(*SrcStmt:*NoDebugIO) NoMain;
Dcl-F CONFIRMED WorkStn IndDs(Ind) UsrOpn;
// Paramètres
Dcl-Pi CONFIRMER Export;
pMessage Char(50);
pReponse Char(1);
End-Pi;
// Indicateurs
Dcl-Ds Ind;
ErrReponse Ind Pos(99);
End-Ds;
// Variables locales
Dcl-S MESSAGE Char(50);
Dcl-S REPONSE Char(1);
Open CONFIRMED;
MESSAGE = pMessage;
REPONSE = 'N';
ErrReponse = *Off;
DoU REPONSE = 'O' or REPONSE = 'N';
ExFmt CONFIRM;
If REPONSE <> 'O' and REPONSE <> 'N';
ErrReponse = *On;
Else;
ErrReponse = *Off;
EndIf;
EndDo;
pReponse = REPONSE;
Close CONFIRMED;
Return;


Commentaires
Enregistrer un commentaire