Recent

Author Topic: ceil -floor functions  (Read 11139 times)

Anonymous

  • Guest
ceil -floor functions
« on: January 24, 2006, 02:17:27 pm »
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;
   num : Real;
   res : Integer;
implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  num :=125.2;
  res  := floor(num);
  Caption:= IntToStr(res);
end;

initialization
  {$I unit1.lrs}

end.
  where is the mistake?lazarus didn't compile this code.

matthijs

  • Hero Member
  • *****
  • Posts: 537
RE: ceil -floor functions
« Reply #1 on: January 24, 2006, 05:43:52 pm »
You should add math to the uses clauss in the implementation section.

And please be more specific next time about the error you received. :)
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Anonymous

  • Guest
RE: ceil -floor functions
« Reply #2 on: January 25, 2006, 03:01:52 pm »
thanks.

 

TinyPortal © 2005-2018