title: Proper structure syntax for Delphi/Pascal if then begin end and ;
body: <p>It has been around 20 years since I last had to write in Pascal. I can't seem to use the structure elements of the language correctly where I am nesting <code>if then</code> blocks using <code>begin</code> and <code>end</code>. For example this gets me an Compiler Error <em>"Identifier Expected"</em>.</p>
  
  <pre class="lang-pascal prettyprint-override"><code>procedure InitializeWizard;
  begin
    Log('Initialize Wizard');
    if IsAdminLoggedOn then begin
      SetupUserGroup();
      SomeOtherProcedure();
    else begin (*Identifier Expected*)
      Log('User is not an administrator.');
      msgbox('The current user is not administrator.', mbInformation, MB_OK);
      end  
    end;
  end;
  </code></pre>
  
  <p>Of course if I remove the <code>if then</code> block and the <code>begin end</code> blocks associated with them then everything is OK.</p>
  
  <p>Sometimes I get it this kind of syntax right and it works out OK, but the problems become exasperated when nesting the <code>if then else</code> blocks. </p>
  
  <p>Solving the problem is not enough here. I want to have a better understanding how to use these blocks. I am clearly missing a concept. Something from C++ or C# is probably creeping in from another part of my mind and messing up my understanding. I have read a few articles about it, and well I think I understand it and then I don't.</p>