Exchange/SNA Manual
Console Program Example
Example Programs
104700 Tandem Computers Incorporated E–15
Page 4 [1] $RJE.EXCHAPPL.CONSRC 1991-05-29 13:38:20
EXCHANGE/SNA CONSOLE APPLICATION EXAMPLE
189. 000000 0 0 PROC display^error (message, length);
190. 000000 1 0 INT .message, length;
192. 000000 1 0 FORWARD;
192.1 000000 0 0
193. 000000 0 0
195. 000000 0 0 !****************************************************************************!
196. 000000 0 0 ! PROCEDURE CONSOLE^READ !
197. 000000 0 0 ! This procedure posts a READ on the console subdevice !
198. 000000 0 0 !****************************************************************************!
199. 000000 0 0 PROC console^read;
200. 000000 1 0 BEGIN
201. 000000 1 1 CALL READ (cons^fnum, ibuf^cons, cons^cnt^out);
204. 000010 1 1 IF <>
205. 000010 1 1 THEN
206. 000011 1 1 BEGIN
207. 000011 1 2 CALL FILEINFO (cons^fnum, error);
209. 000022 1 2 sbuf^term ':=' ["CAN'T READ SERVER FOR CONSOLE OUTPUT -- ERROR: "
210. 000022 1 2 ]-> @sp^term;
211. 000033 1 2 term^out^cnt := @sp^term '-' @sbuf^term;
212. 000037 1 2 CALL NUMOUT (sbuf^term[term^out^cnt-3], error, 10, 3);
216. 000047 1 2 CALL display^error (ibuf^term, term^out^cnt);
218. 000053 1 2 END;
219. 000053 1 1 END;
220. 000000 0 0
221. 000000 0 0
222. 000000 0 0 !****************************************************************************!
223. 000000 0 0 ! PROCEDURE DISPLAY^ERROR !
224. 000000 0 0 ! This procedure writes an error message to the terminal and then stops !
225. 000000 0 0 ! the program. !
226. 000000 0 0 !****************************************************************************!
227. 000000 0 0
228. 000000 0 0 PROC display^error (message, length);
229. 000000 1 0
230. 000000 1 0 INT .message,
231. 000000 1 0 length;
232. 000000 1 0
233. 000000 1 0 BEGIN
234. 000000 1 1 CALL WRITE (term^fnum, message, length);
237. 000010 1 1 IF <>
238. 000010 1 1 THEN
239. 000011 1 1 BEGIN
240. 000011 1 2 CALL FILEINFO (term^fnum, error);
242. 000022 1 2 CALL DEBUG;
243. 000023 1 2 END;
244. 000023 1 1 CALL AWAITIO (term^fnum);
245. 000031 1 1 CALL STOP;
246. 000036 1 1 END;