Exchange/SNA Manual

Send/Receive Program Example
Example Programs
104700 Tandem Computers Incorporated E–5
Page 5 [1] $RJE.EXCHAPPL.EXAPPL 1991-06-04 13:36:52
EXCHANGE/SNA PROGRAMMATIC EXAMPLE
169. 000000 0 0 !OPEN^LINE^PRINTER opens the file specified in the output file of
170. 000000 0 0 ! the startup message. If the file is in use (error 12), the open
171. 000000 0 0 ! operation is tried again. Any other error stops the program.
172. 000000 0 0 ! After the file is open, the printer (or spooler location) is
173. 000000 0 0 ! set to 66 lines a page and single spacing between lines.
174. 000000 0 0
175. 000000 0 0 PROC open^line^printer;
176. 000000 1 0 BEGIN
177. 000000 1 1
178. 000000 1 1 INT file^open := 0;
179. 000000 1 1
180. 000000 1 1 sbuffer ':=' ["BEGIN RECEIVE TEST"] -> @sp;
181. 000013 1 1 write^count := @sp '-' @sbuffer;
182. 000017 1 1 CALL WRITE (term^fnum, ibuffer, write^count);
183. 000027 1 1 IF <> THEN CALL DEBUG;
184. 000031 1 1
185. 000031 1 1 WHILE file^open = 0 DO
186. 000033 1 1 BEGIN
187. 000033 1 2 CALL OPEN (startmsg.outfile, out^fnum);
188. 000046 1 2 IF =
189. 000046 1 2 THEN
190. 000047 1 2 file^open := 1
191. 000047 1 2 ELSE
192. 000052 1 2 BEGIN
193. 000052 1 3 CALL FILEINFO (out^fnum, error);
194. 000063 1 3 IF error <> 12
195. 000063 1 3 THEN
196. 000066 1 3 BEGIN
197. 000066 1 4 sbuffer ':=' ["CAN'T OPEN PRINTER-- ERROR: "] -> @sp;
198. 000077 1 4 write^count := @sp '-' @sbuffer;
199. 000103 1 4 CALL NUMOUT (sbuffer[write^count-3], error, 10, 3);
200. 000113 1 4 CALL WRITE (term^fnum, ibuffer, write^count);
201. 000123 1 4 CALL STOP;
202. 000130 1 4 END;
203. 000130 1 3 END;
204. 000130 1 2 END;
205. 000131 1 1 CALL SETMODE (out^fnum, set^line^spacing, single^space);
206. 000140 1 1 CALL SETMODE (out^fnum, set^lines^page, lines^66);
207. 000147 1 1 space := on;
208. 000151 1 1 END;