Share this page

# Example: lrs_get_static_buffer

In the following example, lrs_get_static_buffer gets a segment of the static buffer received on "socket2", "\xff\xffHost=phobos\r\n". It retrieves six bytes of data at an offset of 7, which is the Host Name.

    char *HostName;

    HostName = lrs_get_static_buffer ("socket2", "buf2", 7, 6, NULL);

    /* The value in HostName is now "phobos" */

    To save the contents of a buffer to a parameter for later use, type:

    lrs_save_param_ex("socket2", "user", HostName, 0, 6, "ascii", "new_parameter");

    lr_output_message("The new parameter = \"%s\"\n", lr_eval_string("< new_parameter >"));

The output generated by the above code, as seen in the VuGen Execution log is:
Message from run.c(52):The new parameter = "phobos"

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: