title: Character x,y in password - LoadRunner
body: <p>I'm doing a load test for a sign in page where the user needs to input 2 characters of their password. </p>
  
  <p>I've created an array of characters to say 'password1'.</p>
  
  <p>Using correlation parameters I'm able to get the character number required. What I'm now trying to do is get the character number and match the array i.e. - </p>
  
  <p><code>Character 1 is required, it will scan the array and bring back char[0].</code></p>
  
  <p><code>Character 2 is required, it will scan the array and bring back char[1] etc.</code></p>
  
  <p>I was thinking of doing a for loop to go through the array and determine where in the array a character is stored. I can't think how to initiate this for loop: </p>
  
  <p><code>char1 = (char1-1);</code></p>
  
  <p><code>char2 = (char2-1);</code></p>
  
  <pre><code>for(i=0;i&lt;10;i++){
      lr_output_message("%s",p[i]);
      if (p[i] == p[char1]){
          char1 = p[i];
      }
  }
  </code></pre>
  
  <p>The for loop works but it equals 115 (s in ASCII), I need a way of converting the value to a character, but I keep getting memory violations.</p>
  
  <p>Sorry if I've over-complicated this issue, but my head has been lost trying to think about how to solve a seemingly easy problem. No doubt some of you will look at it a different way and tell me I've over-complicated it a significant amount! </p>