title: Printing a string as a variable in Pascal
body: <p>This is the string variable that I have:</p>
  
  <pre><code>question1 := 'Please enter 1, 2 or 3.';
  </code></pre>
  
  <p>I also have a function which is supposed to print out the question1 variable, but it generates the question number before printing. Here's a fragment of the function, which turns the question number (<code>question : integer</code>) into a string variable (<code>test : string</code>) and then concatenates the string 'question' with this string variable (<code>test : string</code>).</p>
  
  <pre><code>str(question,test);
  test := concat('question',test);
  writeln(test);
  </code></pre>
  
  <p>The result of this writeln is 'question1' (without the quotes). I want it to output the question1 variable as a text string, not just this variable's name, so that the writeln prints <code>Please enter 1, 2 or 3.</code> I've tried <code>writeln(question1)</code> and it works, however, it appears that my function above (or the fragment of it) does this: <code>writeln('question1')</code>. How do I solve this?</p>