lrs_save_param_ex
Example: lrs_save_param_ex | Correlating Statements Functions |
Saves data from a static, received, or user buffer to a parameter.
int lrs_save_param_ex( char *s_desc, char *type, char *buff, int offset, int length, char *encoding, char *param );
s_desc | A descriptor identifying a socket. |
type | The type of buffer data to save into the parameter. Possible values: user - save the user data, static - save the static buffer that was originally recorded, received - save the buffer(s) received by the last call to lrs_receive. |
buff | Depends on the type of buffer data specified in the type parameter. For user - the pointer to the user buffer, For static - the descriptor of the buffer in the data file, For received - the buff parameter is ignored. |
offset | The offset of the parameter in the buffer. |
length | The parameter length. |
encoding | Used when saving user type buffer data to specify the encoding of the user buffer. Possible values: ascii or ebcdic. A NULL value specifies ascii. The encoding parameter is ignored for static or received type buffer data; it uses the original client format. |
param | The parameter name. |
The lrs_save_param_ex function saves a buffer or part of a buffer to a parameter. The type parameter specifies which type of buffer data to save: the user buffer, the recorded buffer or the last received buffer. This function overwrites the user data area.
When you specify ascii type encoding, buff is expected to be in printable ASCII format, just as it appears in the data file, for example "AAA\x00\xffBBB\r\nCCC". The lrs_save_param_ex function saves the data in ASCII format to a parameter. When the data is used, (e.g., sent) it is translated to ebcdic.
When you specify ebcdic encoding, the function assumes that no translation is required and that the buffer is already in binary ebcdic format. No translation is performed on this buffer when it is used at a later time.
For example:
unsigned char i = 10;
To store the value 10 to a parameter, you must specify ebcdic encoding, to ensure that no translation will be performed.
Note that lrs_save_param_ex does not support parameters in the user buffer. For example, if your buffer contains "A<my_param>A" the value of <my_param> will not be calculated or stored.
For any type of binary data, the WinSock script should call these functions rather than the general lr_save_string or lr_save_var.
Note: This function supersedes lrs_save_param.
Return Values
Parameterization
You cannot use standard parameterization for any arguments in this function.