GDSX (Extended General Device Support) Manual
Using Pseudo Procedures in a TS/MP Environment
Extended General Device Support (GDSX) Manual—529931-001
D-10
USAMPLE1 Listing
292. Int .buf;
293. Begin
294. End;
295.
296.
297. !===========================================================================
298. Proc PROCESS^USER^PARAMS (user^param^buf);
299. !===========================================================================
300. String .user^param^buf;
301. Begin
302. Literal eof = %377;
303. STRING xlate^user^parm^name = 'p' := [
304. !01234567890123 4 56789012345678 9
305. "USERPARAM1 ", 1, "USERPARAM2 ", 2,
306. eof ];
307.
308. STRING
309. .s := @user^param^buf ,
310. item^name [0:13] ;
313. use index; index := 0;
314. While xlate^user^parm^name [index] <> eof Do ! If within table
315. Begin
316.
317. item^name ':=' xlate^user^parm^name [index] for s; ! get table name
318. If item^name = s[1] for s Then ! param name
found
319. Begin
320. @s := @s[s+1] ; ! point to param
value
321. ! assign param
value
322. ! set the desired parameter variable to parm value(s[1] FOR s)
323. goto try^next^param;
324. End
325. Else
326. index := index + 15; ! go to next
param
327. End;
328. drop index;
329.
330. @s := @s [s+1]; ! name not found let us forget it
331.
332. try^next^param:
333. ! if multiple user parm messages are in one
string
334. ! continue to process, otherwise return to
TSCODE
335. Return; ! for further processing
336. End;
337.
338.
339. !===========================================================================
340. Int Proc USER^ATTRIBUTES (sg^cmd, sg^objtype, sg^objname, token^code,
341. token^value);
342. !===========================================================================
343.
344. Int sg^cmd , ! SPI command for this request
345. sg^objtype , ! object type for this request
346. .sg^objname , ! object name for this request
347. .token^value ; ! SPI token value for this token
348. INT(32) token^code ; ! SPI token code
349.
350. Begin
351. Return 0;
352. End;
353.
354. !===========================================================================
355. Proc USER^BACKUP;
356. !===========================================================================
357. Begin
358. End;
360.
361. !===========================================================================
362. Int Proc USER^COMMANDS (iocb, file^error, sg^error) ;