125 lines
3.4 KiB
Plaintext
125 lines
3.4 KiB
Plaintext
|
subroutine U11ED( Resultat, Status, Long )
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Saisie de caracteres avec elimination des caracteres de controle
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intended
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
*
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 08/18/96 18335 MAA Added new code to port 9 to Siemens Nixdorf.
|
||
|
* 01/14/91 7930 JWT Added new Ucode for Siemens/Nixdorf
|
||
|
* 11/07/89 - BHX creation du source
|
||
|
* 26/09/89 - HBI Ajout test ECHO ON/OFF
|
||
|
* 10/09/90 - BHX Abandon de PTERM => TTYGET / TTYSET
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
$INCLUDE UNIVERSE.INCLUDE TTY
|
||
|
$INCLUDE UNIVERSE.INCLUDE DEF.USERS
|
||
|
$INCLUDE UNIVERSE.INCLUDE TERMINFO
|
||
|
*** validiter de la demande
|
||
|
IF (NOT( NUM( Long )) OR Long < 1 OR Long > 500) THEN
|
||
|
Status = 1
|
||
|
*** demande valide
|
||
|
END
|
||
|
ELSE
|
||
|
Status = 0
|
||
|
UnCarAGauche = KEY.MOVE.CURSOR.LEFT
|
||
|
TTYGET tty$ ELSE Status = 1 ; RETURN
|
||
|
SAVEICRNL=CRMODE.ICRNL
|
||
|
CRMODE.ICRNL = 0
|
||
|
TTYSET tty$ ELSE Status = 1 ; RETURN
|
||
|
************
|
||
|
vraidebut: *
|
||
|
************
|
||
|
Resultat = ""
|
||
|
Nombre = 0
|
||
|
IF SYSTEM(26) # CHAR(0) THEN
|
||
|
LongPrompt=1
|
||
|
END ELSE
|
||
|
LongPrompt=0
|
||
|
END
|
||
|
PRINT SYSTEM(26):
|
||
|
FOR Indice = 1 TO Long
|
||
|
PRINT FondDeZone:
|
||
|
NEXT Indice
|
||
|
FOR Indice = 1 TO Long
|
||
|
PRINT UnCarAGauche:
|
||
|
NEXT Indice
|
||
|
********
|
||
|
debut: *
|
||
|
********
|
||
|
*** saisie d'un caractere quelconque de CHAR(0) a CHAR(255)
|
||
|
Command = KEYIN()
|
||
|
IF CASE.INVERT THEN
|
||
|
*** Inversion upcase/downcase
|
||
|
IF Command >= 'a' AND Command <= 'z' THEN
|
||
|
Command = CHAR(SEQ(Command)-32)
|
||
|
END ELSE
|
||
|
IF Command >= 'A' AND Command <= 'Z' THEN
|
||
|
Command = CHAR(SEQ(Command)+32)
|
||
|
END
|
||
|
END
|
||
|
END
|
||
|
*** si fleche a gauche (faire comme backspace)
|
||
|
IF Command = KEY.MOVE.CURSOR.LEFT OR Command = KEY.BACKSPACE THEN
|
||
|
Command = ""
|
||
|
IF Nombre # 0 THEN
|
||
|
Nombre = Nombre - 1
|
||
|
Resultat = Resultat[1,LEN(Resultat)-1]
|
||
|
PRINT UnCarAGauche:FondDeZone:UnCarAGauche:
|
||
|
END
|
||
|
END
|
||
|
*** si caractere de validation
|
||
|
IF Command = Exec OR Command = Envoi THEN
|
||
|
GOTO fin
|
||
|
END
|
||
|
*** si fleche a droite, on remet ca!
|
||
|
IF Command = KEY.MOVE.CURSOR.RIGHT THEN
|
||
|
FOR Indice = 1 TO Nombre+LongPrompt
|
||
|
PRINT UnCarAGauche:
|
||
|
NEXT Indice
|
||
|
GOTO vraidebut
|
||
|
END
|
||
|
IF (Command < CHAR(32)) THEN
|
||
|
Command = ""
|
||
|
END ELSE
|
||
|
Nombre = Nombre + LEN(Command)
|
||
|
END
|
||
|
IF Nombre # Long + 1 THEN
|
||
|
*** cumuler le resultat saisi
|
||
|
Resultat = Resultat:Command
|
||
|
*** Test ECHO ON/OFF
|
||
|
ResulImp=""
|
||
|
IF(SYSTEM(24))THEN ResulImp=Command
|
||
|
PRINT ResulImp:
|
||
|
END ELSE
|
||
|
*** si longueur atteinte, on remet ca!
|
||
|
FOR Indice = 1 TO Nombre-1+LongPrompt
|
||
|
PRINT UnCarAGauche:
|
||
|
NEXT Indice
|
||
|
GOTO vraidebut
|
||
|
END
|
||
|
GOTO debut
|
||
|
END
|
||
|
*******
|
||
|
fin : *
|
||
|
*******
|
||
|
FOR Indice = Nombre TO Long-1
|
||
|
PRINT " ":
|
||
|
NEXT Indice
|
||
|
CRMODE.ICRNL=SAVEICRNL
|
||
|
TTYSET tty$ ELSE Status = 1 ; RETURN
|
||
|
RETURN
|
||
|
END
|