test.pas 503 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. unit test;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. BrookAction;
  6. type
  7. { TMyAction }
  8. TMyAction = class(TBrookAction)
  9. public
  10. procedure Get; override;
  11. end;
  12. implementation
  13. { TMyAction }
  14. procedure TMyAction.Get;
  15. var
  16. I: Integer;
  17. N, V: string;
  18. begin
  19. for I := 0 to Pred(Params.Count) do
  20. begin
  21. Params.GetNameValue(I, N, V);
  22. Write('%d: %s-%s<br />', [I, N, V]);
  23. end;
  24. end;
  25. initialization
  26. // call http://localhost/cgi-bin/cgi1.bf?q1=abc&q2=123
  27. TMyAction.Register('*');
  28. end.