-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathhb_addweight.pas
More file actions
73 lines (47 loc) · 1.14 KB
/
hb_addweight.pas
File metadata and controls
73 lines (47 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
unit hb_addweight;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, Dbf, db, Dbf_Common ;
type
{ TForm4 }
TForm4 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
is_liquid: integer;
end;
var
Form4: TForm4;
implementation
{ TForm4 }
uses HB_Main;
procedure TForm4.Button1Click(Sender: TObject);
var
MyDbf: TDbf;
begin
MyDbf := TDbf.Create(nil) ;
MyDbf.FilePathFull := '';
MyDbf.TableName := Form1.substances_used_db;
MyDbf.Open ;
MyDbf.Active := true ;
MyDbf.Filter := 'Name=' + QuotedStr(Label2.Caption) ;
MyDbf.Filtered := true; // This selects the filtered set
MyDbf.First;
MyDbf.Edit;
MyDbf.FieldByName('Weight').AsFloat:= StrtoFloat(Edit1.Text) ;
MyDbf.Post ;
MyDbf.Close ;
MyDbf.Free ;
Form4.Visible := False ;
end;
initialization
{$I hb_addweight.lrs}
end.