title: How to avoid SIGSEGV Errors on FPC compiler?
body: <p>I'm currently having several problems with access violations in the program I'm building for my programming course. It is being build in pascal (the language used by the course) and using the Lazarus IDE (similar to Delphi but open).</p>
  
  <p>As far as I know, Access Violations, or SIGSEGV errors, occurs when you try to use or address an invalid memory location. I've been trough a lot of these, specially when I wasn't declaring the length of dynamic arrays.</p>
  
  <p>Now It seems I'm having this trouble with strings. (Or I might be derping with multi-dimensional arrays).</p>
  
  <p>I'll paste only the procedure where the SIGSEGV is pointing, but the context is:</p>
  
  <p>I have an array of integers and a multi-dimensional array containing it's power set <strong>(subconjuntos)</strong>, the function where the error is poping (described below) is used to print this power set to a TextBox(indexed by <strong>local</strong>):</p>
  
  <pre><code>procedure writeSub(local: TEdit);
  var
    i, j: integer;
  begin
   for i:= 0 to High(subconjuntos)+1 do
     if Length(subconjuntos[i])&gt;1 then
     begin
       local.Text:=local.Text+'[';
       for j:=0 to High(subconjuntos[i])+1 do local.Text:=local.Text+'('+IntToStr(subconjuntos[i][j])+') ';
       local.Text:=local.Text+'] ';
     end
     else local.Text:=local.Text+'['+IntToStr(subconjuntos[i][0])+'] '; {this is where I'm having the SIGSEG, the program wont compile if I don't reference it without the double brackets}
  end;  
  </code></pre>
  
  <p>Any ideas why it is throwing SIGSEGV's?</p>