SUBROUTINE ASKINI C C C Purpose of the routine: Check to see if the consol is a modern C one, understansding "Escape sequences" (e.g. VT 100, LA 34 or LA 120) C or not (e.g. LA 36) C C This routine is a new one that didn't exist in RJ CARPENTER version. C C C Original version : J P Lamargot 10-Sep-82 C C This version : J P Lamargot 10-Sep-82 C C+++ C Traduction des messages en francais C Gestion du curseur sur une VT 100 pour C - Ecriture des messages sur la 24eme ligne C - Saisie de la nouvelle reponse au meme endroit C que celle qui etait erronnee, apres effacement de celle-ci C--- C DIMENSION IAM(7) BYTE ASKSAV(3),ASKCLN(16),ASKMS0(17),ASKMS1(25),BREP COMMON /ASKCLN/ ASKCLN COMMON /ASKMES/ ASKMS0,ASKMS1 COMMON /ASKINI/ IAM,ASKSAV C C------ Send "Who are you ?" ------------------------------------------------- TYPE 100,"33 100 FORMAT(1H$,A1,'[0c') C------ Turn consol to special mode: Noecho, Nowait -------------------------- JSW = IPEEK("44) CALL IPOKE("44,JSW.OR."10100) C------ Give consol time enough to answer (but not too much) ----------------- C DO 1 I = 1,10000 C1 CONTINUE C------ Accept "I am" if the consol understood "Who are you" ----------------- J = 0 BREP = .FALSE. DO 10 I = 1,2000 IREP = ITTINR() IF (IREP.EQ."33) BREP = .TRUE. IF (BREP.EQ..FALSE.) GO TO 10 IF (IREP.LT.0) GO TO 10 J = J + 1 IF (J.GT.7) GO TO 10 IAM(J) = IREP 10 CONTINUE C------ Turn consol back to normal mode -------------------------------------- CALL IPOKE("44,JSW) IF (IAM(1).EQ."33) RETURN !OK Nothing else to do C------ The consol didn't answer ===> suppress "Escape sequences" ------------ ASKSAV(2) = "33 ! DO 11 I = 1,15 ! ASKCLN(I) = "33 ! Non-printing 11 CONTINUE ! characters DO 12 I = 1,8 ! instead of ASKMS0(I) = "33 ! "Escape 12 CONTINUE ! sequences" DO 13 I = 20,24 ! ASKMS1(I) = "33 ! 13 CONTINUE ! C------ End of the routine --------------------------------------------------- RETURN C C END