GDSX Manual
Using Pseudo Procedures in a NonStop TS/MP
Environment
Extended General Device Support (GDSX) Manual–134303
D-24
USAMPLE2 Listing
104. Int .EXT Replied^Len := 0D; -- variables for
^SERVER_CLASS_SEND_
105. Int .EXT Sc^Op^Num := 0D; --"--
106. Int .EXT Pathsend^Error := 0D; --"--
107.
108. Int Ferr := 0; -- file error
109. Int Filenum := 0; -- file number for ^Listen
110. Int Evt := 0; -- event
111
112. String .Ascii^Result[0:2]; -- ASCII buffer for Numout
113.
114.
116. !===========================================================================
117. SubProc Initialize^Device^Handler;
118. !===========================================================================
119. Begin
120.
121. ! reserve all the buffers we need
122. @RCV^Buf := GetExtPool(11,32); ! From Message Pool
123. If @RCV^Buf = 0D Then
124. Call Debug;
125.
126. @Term^Buf := GetExtPool(11,32); ! From Message Pool
127. If @Term^Buf = 0D Then
128. Call Debug;
129.
130. @Work^Buf := GetExtPool(10,32); ! From Buffer Pool
131. If @Work^Buf = 0D Then
132. Call Debug;
133.
134. ! reserve all buffers for Serverclass_Send_
135. @Replied^Len := GetExtPool(10,1); ! From Buffer Pool
136. If @Replied^Len = 0D Then
137. Call Debug;
138.
139. @Sc^Op^Num := GetExtPool(10,1); ! From Buffer Pool
140. If @Sc^Op^Num = 0D Then
141. Call Debug;
142.
143. @Pathsend^Error := GetExtPool(10,2); ! From Buffer Pool
144. If @Pathsend^Error = 0D Then
145. Call Debug;
146.
147. Replied^Len := 0;
148. Sc^Op^Num := 0;
149.
150. -- write the first buffer and wait for the first message
151. Term^Buf ':=' "Enter your text: xnnnkkkkkkkkkkk.... " & Term^Buf[18] for
12;
152. Call ^WriteReadX(Term^File^Num, Term^Buf, 50, 62);
153. -- let's Return to the main-loop
154. Return;
155. End;
157.
159. !===========================================================================
160. Int SubProc Check^Buffer;
161. !
162. !===========================================================================
163. ! we return the value 0, when we detected an error
164. ! we return the value 1, when the buffer is OK
165. !===========================================================================
166 Begin
167
168. Int S^Error;
169.
170. S^Error := String_Upshift_ (S^Term^Buf[0]:1,S^Term^Buf[0]:1);
171. If S^Error Or
172. S^Term^Buf[0] <> ["W"] And
173. S^Term^Buf[0] <> ["D"] Then Begin
174. Term^Buf ':=' "wrong function code (x) (must be 'd' or 'w') " &
175. Term^Buf[22] For 18 Bytes;
176. Return 0;