Example: lrs_hex_string_to_int
In the following example, the script compares the displayed value with value in the buffer. The lrs_hex_string_to_int converts a hexadecimal string to an integer.
Action()
{
char* tmp;
char* tmp2;
int i = 0;
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=server2.abc.co.il:23", LrsLastArg);
lrs_receive("socket0", "buf0", LrsLastArg);
tmp = lrs_get_received_buffer("socket0", 5, 2, NULL);
if ( ! lrs_hex_string_to_int(tmp,2,&i))
{
lr_output_message("i=%d",i);
/* compare i with the same selection in the data.ws and displayed value (F7) */
}