Subroutine: WKEY Purpose: Write keywords to a task parameter list Category: USER-INTERFACE File: srvreq.c Author: J.P. Terlouw Use: CALL WKEY( TEXT ) Input, character TEXT A character string containing keywords and values, optionally prefixed by a taskname Description: This routine writes keyword-value pairs to the parameter list of the calling task or, if the name of a different active task is specified, to the parameter list of that task. Writing to the own parameter list is the most common. It can be used to pass parameter information back and forth between members of a chain of tasks initiated via calls to DEPUTY. It is also used in event-driven programs in connection the GIPSY's graphical user interface (Ggi). Writing to an other task's parameter list can be useful when one task needs to influence an other task. For example a processing task could cause a display task to display the processed data. If the addressed task is event-driven, the calling task will wait until the addressed task has read all keywords written with this call or until the addressed task exits. In case of error, no action is performed and WKEY just returns. Examples: a) "bare" call: CALL WKEY('POS=PC, SET=0,1 PRINT=YES') b) Suppose TASK1 computes the value of a parameter PARM1 which is needed as input to TASK2 which is called via DEPUTY. Then in TASK1 the programmer codes: PROGRAM TASK1 CHARACTER*20 STRING . . PARM1=... WRITE(STRING,'(''KEY1='',F10.4)') PARM1 CALL WKEY(STRING) CALL DEPUTY('TASK2',IER) . . END The task receiving the keyword could be coded as follows: PROGRAM TASK2 . . N = USERREAL(VALUE,1,0,'KEY1=','Value, please') . . . END Note that TASK2 calls USRINP in a standard way and that it is unaware of the fact that the keyword has been prepared by its caller. c) In a similar way it is also possible that a spawned task prepares keywords for its caller: PROGRAM TASK1 . . CALL DEPUTY('TASK2',IER) N = USERINT(...,'KEY=',...) . . . END PROGRAM TASK2 . . CALL WKEY('KEY=...') . . END d) Write to other task: CALL WKEY('SLICEVIEW READSUB=YES') Related docs: DEPUTY.DC2, SUBST.DC2 Updates: Sep 4, 1981: JPT, Original document. Feb 15, 1990: JPT, Portable version, rewritten in ANSI C. Jan 16, 2001: JPT, Implement writing to other tasks. Apr 14, 2011: JPT, Document changed behaviour w.r.t. event-driven tasks.