18. august 2004 - 08:01
Der er
2 kommentarer og
3 løsninger
Hjælp kan ikke finde ud af det..
Nogle her der kan hjælpe mig med at komme igang med Delphi ?? jeg er lidt af en knold med lige at forstå prinsippet i en start på koder så hvis en eller anden har en lille kode (fil) jeg kunne få lov at se lidt nermere på (med opbygning og sådan) og hjælpe mig lidt ville jeg blive meget glad.
18. august 2004 - 08:22
#1
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask, DB, DBTables, QuickRpt,
QRCtrls;
type
TForm1 = class(TForm)
DBComboBox1: TDBComboBox;
DBComboBox2: TDBComboBox;
DBComboBox3: TDBComboBox;
DBComboBox4: TDBComboBox;
DBComboBox5: TDBComboBox;
Table1: TTable;
DataSource1: TDataSource;
DBComboBox6: TDBComboBox;
DBComboBox7: TDBComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
DBComboBox8: TDBComboBox;
DBComboBox9: TDBComboBox;
DBEdit1: TDBEdit;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
DBNavigator1: TDBNavigator;
ComboBox1: TComboBox;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Panel1: TPanel;
QuickRep1: TQuickRep;
QRBand2: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRDBText10: TQRDBText;
QRLabel11: TQRLabel;
QRLabel12: TQRLabel;
QRLabel13: TQRLabel;
QRLabel14: TQRLabel;
QRLabel15: TQRLabel;
QRLabel16: TQRLabel;
QRLabel17: TQRLabel;
QRLabel18: TQRLabel;
QRLabel19: TQRLabel;
QRLabel32: TQRLabel;
GroupBox1: TGroupBox;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
PageHeaderBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel20: TQRLabel;
QRLabel2: TQRLabel;
QRLabel21: TQRLabel;
QRLabel3: TQRLabel;
QRLabel22: TQRLabel;
QRLabel4: TQRLabel;
QRLabel31: TQRLabel;
QRLabel5: TQRLabel;
QRLabel23: TQRLabel;
QRLabel6: TQRLabel;
QRLabel24: TQRLabel;
QRLabel7: TQRLabel;
QRLabel25: TQRLabel;
QRLabel8: TQRLabel;
QRLabel26: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRLabel27: TQRLabel;
QRLabel33: TQRLabel;
QRLabel35: TQRLabel;
QRLabel34: TQRLabel;
PageFooterBand1: TQRBand;
QRSysData1: TQRSysData;
QRLabel28: TQRLabel;
QRLabel29: TQRLabel;
QRLabel30: TQRLabel;
QRLabel36: TQRLabel;
QRLabel37: TQRLabel;
QRLabel38: TQRLabel;
QRLabel39: TQRLabel;
QRLabel40: TQRLabel;
QRLabel41: TQRLabel;
QRLabel42: TQRLabel;
QRLabel43: TQRLabel;
QRDBText11: TQRDBText;
DBEdit2: TDBEdit;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
QRLabel44: TQRLabel;
Label29: TLabel;
DBEdit3: TDBEdit;
QRDBText12: TQRDBText;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Table1AfterOpen(DataSet: TDataSet);
procedure Table1AfterPost(DataSet: TDataSet);
procedure Button1Click(Sender: TObject);
procedure QuickRep1StartPage(Sender: TCustomQuickRep);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Table1.Open;
Form1.Height:=292;
Form1.Width:=535;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
procedure TForm1.Table1AfterOpen(DataSet: TDataSet);
var
I, I2, I3, I4, I5, I6, I7, I8 : Integer;
begin
I:=0;
I2:=0;
I3:=0;
I4:=0;
I5:=0;
I6:=0;
I7:=0;
I8:=0;
Table1.First;
while not Table1.eof do
begin
I:=table1.fieldByname('Hft').asInteger+I;
label18.Caption:=IntToStr(i);
I2:=table1.fieldByname('Klt').asInteger+I2;
label19.Caption:=IntToStr(I2);
I3:=table1.fieldByname('Age').asInteger+I3;
label20.Caption:=IntToStr(i3);
I4:=table1.fieldByname('Agd').asInteger+I4;
label21.Caption:=IntToStr(i4);
I5:=table1.fieldByname('Agm').asInteger+I5;
label22.Caption:=IntToStr(i5);
I6:=table1.fieldByname('Atd').asInteger+I6;
label23.Caption:=IntToStr(i6);
I7:=table1.fieldByname('Orx').asInteger+I7;
label25.Caption:=IntToStr(i7);
I8:=table1.fieldByname('ssys').asInteger+I8;
label27.Caption:=IntToStr(i8);
Table1.Next;
end;
table1.first;
end;
procedure TForm1.Table1AfterPost(DataSet: TDataSet);
var
I, I2, I3, I4, I5, I6, I7, I8 : Integer;
begin
I:=0;
I2:=0;
I3:=0;
I4:=0;
I5:=0;
I6:=0;
I7:=0;
I8:=0;
Table1.First;
while not Table1.eof do
begin
I:=table1.fieldByname('Hft').asInteger+I;
label18.Caption:=IntToStr(i);
I2:=table1.fieldByname('Klt').asInteger+I2;
label19.Caption:=IntToStr(I2);
I3:=table1.fieldByname('Age').asInteger+I3;
label20.Caption:=IntToStr(i3);
I4:=table1.fieldByname('Agd').asInteger+I4;
label21.Caption:=IntToStr(i4);
I5:=table1.fieldByname('Agm').asInteger+I5;
label22.Caption:=IntToStr(i5);
I6:=table1.fieldByname('Atd').asInteger+I6;
label23.Caption:=IntToStr(i6);
I7:=table1.fieldByname('Orx').asInteger+I7;
label25.Caption:=IntToStr(i7);
I8:=table1.fieldByname('ssys').asInteger+I8;
label27.Caption:=IntToStr(i8);
Table1.Next;
end;
table1.first;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with DataSource1 do
Table1.Locate(ComboBox1.Text,Edit1.Text,[loPartialKey]);
end;
procedure TForm1.QuickRep1StartPage(Sender: TCustomQuickRep);
begin
QRLabel29.Caption:=Label18.Caption;
QRLabel30.Caption:=Label19.Caption;
QRLabel36.Caption:=Label20.Caption;
QRLabel37.Caption:=Label21.Caption;
QRLabel38.Caption:=Label22.Caption;
QRLabel39.Caption:=Label23.Caption;
QRLabel40.Caption:=Label25.Caption;
QRLabel44.Caption:=Label27.Caption;
end;
end.
18. august 2004 - 13:52
#3
Der findes en dansk Delphibog af Ole Monrad. Titlen er "Programmering
med Delphi x" (er vist nået til version 6, men det betyder ikke noget hvis man skal lære at programmere). Det findes på bibliotekerne.