Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var
WordApp : variant;
begin
try
WordApp:= CreateOleObject('Word.Application');
WordApp.Visible := True; //set to false to run with no user
WordApp.ActiveDocument.PrintOut;
WordApp.ActiveDocument.Close(0); //0 - no save
finally
WordApp.Quit;
end;
end;
$APPTYPE CONSOLE}
program part13; uses sysutils;
{ Delphi 3.0 version }
var
drive: string;
fileinput: string;
procedure listdirsizes(filedir: string);
var
f, s: string;
dirinfo: TSearchRec;
retcode: longint;
begin
f := filedir + '\*.*';
FindFirst(f, faAnyFile-faVolumeID-faDirectory, dirinfo);
repeat
writeln(dirinfo.name);
if dirinfo.name = fileinput then
writeln('Found: ', filedir + '\' + dirinfo.name);
until (FindNext(dirinfo) <> 0);
FindClose(dirinfo);
FindFirst(f, faDirectory, dirinfo);
repeat
if (dirinfo.attr = faDirectory) and (dirinfo.name <> '.')
and (dirinfo.name <> '..') then
begin
s := filedir + '\' + dirinfo.name;
listdirsizes(s);
end;
until (FindNext(dirinfo) <> 0);
FindClose(dirinfo);
end;
procedure writehelp;
begin
writeln('Include a drive and a file name');
writeln('FSEARCH C: README.TXT');
halt(1);
end;
function upstr(instr: string): string;
var
tempstr: string;
i: integer;
begin
tempstr := '';
for i := 1 to length(instr) do
tempstr := tempstr + upcase(instr[i]);
upstr := tempstr;
end;
begin
writeln('FSEARCH copyright 2005 by Glenn9999 in tek-tips.com.');
writeln('Use of any of this code must include the copyright ',
'statement listed above.');
writeln;
if paramcount <> 2 then
writehelp;
drive := paramstr(1);
if (length(drive) <> 2) or (drive[2] <> ':') then
writehelp;
drive[1] := upcase(drive[1]);
fileinput := upstr(paramstr(2));
if (length(fileinput) > 12) or (fileinput = ' ') then
writehelp;
listdirsizes(drive);
end.
[navy][i]// for automatic syntax highlighting see faq102-6487
[/i][/navy][b]uses[/b]
Registry;
[b]var[/b]
FOfficeDir: String;
[b]begin[/b]
[b]with[/b] TRegistry.Create [b]do[/b]
[b]try[/b]
RootKey := HKEY_LOCAL_MACHINE;
[b]if[/b] OpenKey([teal]'\Software\Microsoft\Windows\CurrentVersion\App Paths\EXCEL.EXE'[/teal], False) [b]then[/b]
[b]begin[/b]
FOfficeDir := IncludeTrailingPathDelimiter(ReadString([teal]'Path'[/teal]));
CloseKey;
[b]end[/b];
[b]finally[/b]
Free;
[b]end[/b];
[b]end[/b];