title: How to read two strings from the same line in Pascal?
body: <p>I'm trying to read two string variables from the same line in pascal.<br>
  The two strings are separated by empty space.</p>
  
  <p>I've tried reading it like one string, then separating it on two parts, but then I have a problem because the string is bigger than 255 characters.</p>
  
  <p>Here is the string I'm trying to read:</p>
  
  <blockquote>
    <p>kyGOwpLobZvGynmdpiujxhUwphFsTTipuyAwpeffcckLuPouxmpQwGeMxqDoIqeWVkpdLueirlLiabfhxjnwbyMDYUfhGmlnFJdmfhtxljPqicbotSBvkKaQdsmbyrhmmSdexHjwdnecjRtzef mkhRyGOwpLobZvGynmdpiujxhUwphFsTTipuyAwpeffcckLumWbnbfdhlzFmnkkrwNsewPouxmpQwGeMxqDoIqeWVkpdLueirlLiabfhxjnwbyMDYUfhGmlnFJdmfhtxljPqicbotSBvkKaQdsmbyrhmmSdexHjwdnecjRtzeajfz`</p>
  </blockquote>
  
  <p>The line is not always the same length, and the empty space is not on the same location.  </p>
  
  <p>I'm trying to figure out if by deleting some characters from the second string you can get the first one.</p>
  
  <p>Example: STRING aSgasTsaRoIgfNfdsG<br>
  should result a positive answer.</p>
  
  <p>Here is the code that checks for that.</p>
  
  <pre><code>q:=1;  
  for m:=1 to length(b) do  
  begin  
  if b[m] = a[q] then  
  q:=q+1;
  end;
  
  q:=q-1;
  
  writeln(q);
  
  if q = length(a) then  
  writeln('YES')  
  else  
  writeln('NO');
  </code></pre>
  
  <p>where a is the first string, b is the second one.</p>
  
  <p>I'm reading the first big string as one variable and then cut it in two parts.<br>
  The problem occurs when the first string is bigger than 255 characters. That's why I want to know how I can read two strings from the same line.</p>
  
  <p>The code I'm using to separate the strings:</p>
  
  <pre><code>readln(x);  
  
  x:=LONGSTRINGHERE;  
  blank:=' ';
  Location := Pos(blank, x);  
  
  a:=Copy(x, 1, (Location-1));  
  
  b:=Copy(x, (Location+1), length(x)); 
  </code></pre>