rendered paste bodyunit ui;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
ExtCtrls, ComCtrls, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
tb1: TTrackBar;
tb2: TTrackBar;
procedure tb1Change(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{ TForm1 }
function f2C(faren: integer): Double;
var
calc: Double;
left: Double;
times: Double;
begin
WriteLn('faren= ', faren);
times:= 5 / 9;
//times:= 0.555555555556;
WriteLn('times= ', times);
left:=faren-32.0;
calc := left*times;
writeln('Rezultat', calc);
f2C := calc;
end;
procedure TForm1.tb1Change(Sender: TObject);
var
pc: PChar;
brojs: String;
broj: Double;
begin
broj := f2c(tb1.Position);
brojs := FloatToStr(broj);
pc := PChar(brojs);
tb2.Position:=round(broj);
end;
initialization
{$I ui.lrs}
end.