type TForm1 = class(TForm) Hent : TButton; ListBox1 : TListBox; Edit1 : TEdit; Label1 : TLabel; procedure HentClick(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
Function Vis(Vis : String; Tal :Integer ) : String; Var F : TextFile; S : String; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); while not EOF(F) do begin ReadLn(F, S); vis := s; end; CloseFile(F);
end;
procedure TForm1.HentClick(Sender: TObject);
var
S : String; i: Integer;
begin For i := 1 to 5 do begin S:= Vis(Vis, i); ListBox1.Items.Add(S); Label1.caption := inttostr(i); end;
Function Vis(Vis : String; Tal :Integer ) : String; Var F : TextFile; S : String; i : integer; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); while not EOF(F) do begin for i := 1 to tal do ReadLn(F, S); vis := s; end; CloseFile(F);
Function Vis(var Vis : String; Tal :Integer ) : String; Var F : TextFile; S : String; i : integer; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); while not EOF(F) do begin for i := 1 to tal do ReadLn(F, S); vis := s; end; CloseFile(F);
nu skriver den kun den sidst linje fra tekst fil!!
men ikke sende antal linje med i en værdi ??
Function Vis(Tal :Integer ) : String; // Antal_lj????
procedure
begin For i := 1 to 3 do // Antal_lj????? begin S:= Vis(i); ListBox1.Items.Add(S + IntToStr(1)); ListBox2.Items.Add(S); Label1.caption := inttostr(i); end;
Function Vis(var Vis : String; Tal :Integer ) : String; Var F : TextFile; S : String; i : integer; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); if not EOF(F) do <-- WHILE FJERNET begin for i := 1 to tal do ReadLn(F, S); vis := s; end; CloseFile(F); end;
Function Vis(var Vis : String; Tal :Integer ) : String; Var F : TextFile; S : String; i : integer; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); if not EOF(F) THEN <-- THEN INDSAT begin for i := 1 to tal do ReadLn(F, S); vis := s; end; CloseFile(F); end;
Function Vis(Tal :Integer ) : String; Var F : TextFile; S : String; i : integer; Begin AssignFile(F, 'D:\Delphi\txt\txt.txt'); Reset(F); if not EOF(F) Then begin for i := 1 to tal do ReadLn(F, S); vis := s; end; CloseFile(F);
begin For i := 10 to do // Antal_lj????? begin S:= Vis(i); ListBox1.Items.Add(S + IntToStr(1)); ListBox2.Items.Add(S); Label1.caption := inttostr(i); end;
den lave streger i sidst linje ??
men sende antal linje med fra Function
For i := 1 to --- så det skrive her i en varlpil du ved
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.