GDSX (Extended General Device Support) Manual
Using Pseudo Procedures in a TS/MP Environment
Extended General Device Support (GDSX) Manual—529931-001
D-25
USAMPLE2 Listing
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;
177. End;
178.
179. If Not $Numeric(S^Term^Buf[1]) Or
180. Not $Numeric(S^Term^Buf[2]) Or
181. Not $Numeric(S^Term^Buf[3]) Then Begin
182. Term^Buf ':=' "loop-counter (nnn) is not numeric " &
183. Term^Buf[17] For 28 Bytes;
184. Return 0;
185. End;
186.
187. -- everything is OK
188. Return 1;
189. End;
190.
191.