Blog

  • Vugen: strcmp Example

    Posted on July 25, 2012 by Admin

    I was asked to post a simple strcmp example for use in Vugen scripting. Here it is:
    if (strcmp(lr_eval_string(“{pParameter}”), “”) == 0)
    {
    lr_error_message(“No parameter value captured. Ending iteration.”);
    return 0;
    }
    else{
    lr_output_message(“The parameter value is %s”,
    lr_eval_string(“{pParameter}”));
    };
    Anyone care to elaborate in the comments section as to what this code is doing? Read Entire Entry

  • Vugen: Will This Code Remove Trailing Spaces?

    Posted on July 9, 2012 by Admin

    Let’s have a little fun today – and hopefully I can get some interaction from you C Guru’s out there. How about something cryptic in C? Let’s say I wanted to remove some trailing spaces with as few lines of C code as possible. Will the example below work?
    static char* rtrim( char* s)
    {
    int i;
    if (s){i = strlen(s); while ((–i)>0 && isspace(s[i]) ) s[i]=0;}
    return s;
    };
    Why or why not? Care to explain what this code is doing? Comments are open and welcome. Read Entire Entry