Retrieving parameters

To process parameters, an application must:

  1. Call srv_numparams to determine how many parameters, if any, the command includes.

  2. Call srv_descfmt to obtain a description of each parameter. Among other things, the description will indicate if the parameter is a return parameter. If it is, the retrieval process stops here. If the parameter is an input parameter, the application must continue with steps 3 and 4.

  3. Call srv_bind to provide program variables in which to store the parameter data coming over the network from the client.

  4. Call srv_xferdata to transfer the client data into the application program variables specified in step 3.

Return parameters contain no valid data when retrieved from a client. The application fills valid data in when it returns the return parameters to the client. Open Server transparently converts the return parameter format from the program variable format to the client format.

Note that from within a SRV_LANGUAGE handler, an application can “construct” return parameters out of an undifferentiated language stream without having first retrieved actual parameters. See “Returning parameters in a language data stream”, for further explanation.

srv_descfmt and srv_bind are called once for each parameter, while srv_xferdata is called once for the entire parameter stream. An application must not call srv_xferdata until all parameters have been described and bound.

An application must invoke the three routines with their cmd arguments set to CS_GET, as the application retrieves information from the client.