Forum > Beginners
code check
FTurtle:
This is whole module which I compiled:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---unit unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls; type { TForm1 } TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Edit1: TEdit; ListBox1: TListBox; StatusBar1: TStatusBar; procedure Button3Click(Sender: TObject); private { private declarations } public { public declarations } end; var Form1: TForm1; implementation {$R *.lfm} procedure TForm1.Button3Click(Sender: TObject);var sa: string; sb: string; sc: string; myDateTime1: TDateTime; myDateTime2: TDateTime; myDateTime3: TDateTime; oldName, newName: string; i, renameCount: integer; NameA, nameB: string;begin myDateTime1 := 0; myDateTime2 := 42410; myDateTime3 := now(); sc := FormatDateTime('dd.mm.yyyy', myDateTime3); if myDateTime3 < myDateTime2 then begin if (ListBox1.Count > 0) then begin renameCount := 0; for i := 0 to ListBox1.Count - 1 do begin if ExtractFileExt(ListBox1.Items[i]) = ('.txt') then begin NameA := (extractFilePath(Listbox1.Items[i])); NameB := Copy((extractFileName(Listbox1.Items[i])), 5, 10); oldName := ListBox1.Items[i]; newName := (NameA) + (Edit1.Text) + (NameB); if RenameFileUTF8(oldName, newName) then Inc(renameCount); end; end; StatusBar1.SimpleText := Format(' %d files renamed', [renameCount]); end else begin sleep(200); ShowMessage('You waited too long' + sLineBreak + 'Expired at ' + sc); sleep(200); Close; end; end;end; end.
scons:
allright, got it now !
thanks for helping out guys.
Navigation
[0] Message Index
[*] Previous page