anchor.diff:  end;
   
   procedure TMainForm.MainFormShow(Sender: TObject);
  -{$IFDEF Timing}
  -var
  -  t: TEpikTimer;
  -{$ENDIF}
   begin
     bvlBody.Realign;
   
  -  if Paramcount > 0 then
  -  begin
  -    {$IFDEF Timing}
  -    t := TEpikTimer.Create(nil);
  -    t.Start;
  -    {$ENDIF}
  -    OpenFile(ParamStr(1), '', True);
  -    {$IFDEF Timing}
  -    t.Stop;
  -    writeln(t.ElapsedDHMS);
  -    {$ENDIF}
  -  end;
     // restore previous window position and size
     gINI.ReadFormState(self);
     PageControl1.Width := gINI.ReadInteger('Options', 'SplitterLeft', 260);
  
positive.code:   { TODO -ograemeg -copen files : Implement ParseAndExpandFilenames }
    tmpFileNames.Add(AFileName);
  //  ParseAndExpandFileNames(FileName, tmpFileNames);
    Result := OpenFiles( tmpFileNames,
                         AWindowTitle,
                         DisplayFirstTopic );
    tmpFileNames.Destroy;
  end;
  
  
negative.code:   DisplayTopic( Topic );
  end;
  
  procedure TMainForm.ProcessCommandLineParams;
  var
    showtopic: boolean;
  begin
    // always load file first, otherwise show help
    if ParamCount > 0 then
    begin
      if gCommandLineParams.IsParam('h') then
        ShowParamHelp
      else
      begin
        showtopic := not gCommandLineParams.IsParam('s');
        OpenFile(ParamStr(1), '', showtopic);
      end;
    end;
  
    // now process all other parameters
    if gCommandLineParams.IsParam('s') then
    begin
      edSearchText.Text := gCommandLineParams.GetParam('s');
      PageControl1.ActivePage := tsSearch;
      btnSearch.Click;
    end;
  end;
  
  procedure TMainForm.ShowParamHelp;
  const
    le = LineEnding;
  var
    s: string;
  begin
    s := '<font "Arial" 12><b>' + cLongName + '</b></font>' + le
         + cVersion + le + le
         + 'Supported command line parameters:' + le + le
         + '<tt>'
         + '  <<filename>   Load the help file <<filename>' + le
         + '  -h           Show this help' + le
         + '  -s<<text>     Search for <<text> in open help files' + le
         + '  -t<<id>       Open Topic with ID equal to <<id>' + le
         + '</tt>'
         ;
    RichView.AddText(PChar(s));
  end;
  
  
  end.
  