home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS 1
/
BBS#1.iso
/
document
/
mn894.ha
/
DVISION.TXT
< prev
next >
Wrap
Text File
|
1994-10-11
|
8KB
|
240 lines
îὫ »«½πτ¿Γ∞ ¿¡Σ«α¼áµ¿ε ¿º íáºδ ñá¡¡δσ, ¡áñ« ÑΘÑ ßπ¼ÑΓ∞ »αÑñßΓáó¿Γ∞
ÑÑ ó πñ«í¡«¼ ñ½∩ »«½∞º«óáΓѽ∩ Σ«α¼áΓÑ. Ç ó«Γ ¬á¬ φΓ« ßñѽáΓ∞ ó Data
Vision?
ï¿ßΓ¿¡ú 1. ÆѬßΓ »α«úαá¼¼δ óó«ñá ¡á »ÑτáΓ∞ ¿¡Σ«α¼áµ¿¿ ¿º DBF-íáºδ
program DataBaseWriter;
uses
CRT,DVReport,DVUtil,DVDefDB,DVDBase,DVDefine;
const
Prompt = #10#13'Data Vision .DBF writer (c) Shift Laboratory.'#10#13;
BadParam = #10#13'Usage: DBW <DataBase_File_Name>'#10#13;
Ok = 'done.';
type
PMyReport = ^TMyReport;
TMyReport = object(TReport)
function GetField(FieldNumber: byte): string; virtual;
procedure ShowInfo; virtual;
procedure EndOfPage; virtual;
procedure Errors;
procedure Warnings;
end;
var
Report : PMyReport;
Base : PDefDB;
function TMyReport.GetField(FieldNumber: byte): string;
const
PrevFld: byte = 0;
var
i : byte;
tmpStr : string;
function XFldLen(FieldNumber: byte): byte;
begin
with DBMS^ do
if Length(TEFldName(FieldNumber)) > TEGetLen(FieldNumber) then
XFldLen:=Length(TEFldName(FieldNumber))
else
XFldLen:=TEGetLen(FieldNumber);
end;
function Format(AStr: string; ALen: byte): string;
begin
if ALen > Length(AStr) then
Format:=AStr+Dup(ALen-Length(AStr),' ')
else
Format:=AStr;
end;
begin
case FieldNumber of
255: GetField:='┌'+Dup(Length(GetField(253))-3,'─')+'┐';
254: begin
tmpStr:='│ ';
for i:=1 to DBMS^.TETotalFld do
tmpStr:=tmpStr+Format(DBMS^.TEFldName(i),XFldLen(i))+' │ ';
GetField:=tmpStr;
end;
253: begin
tmpStr:='│ ';
for i:=1 to DBMS^.TETotalFld do
tmpStr:=tmpStr+Format(TReport.GetField(i),XFldLen(i))+' │ ';
GetField:=tmpStr;
end;
252: GetField:=ParamStr(1);
251: GetField:='├'+Dup(Length(GetField(253))-3,'─')+'┤';
250: GetField:='└'+Dup(Length(GetField(253))-3,'─')+'┘';
else
if FieldNumber > DBMS^.TETotalFld then
GetField:=NumToStr(DBMS^.TEGetReal(PrevFld))
else
GetField:=TReport.GetField(FieldNumber);
end;
PrevFld:=FieldNumber;
end;
procedure TMyReport.ShowInfo;
var
tmpByte: byte;
begin
if DBMS^.TETotalRec > 1 then
with DBMS^ do
tmpByte:=trunc(TERecNo*100/TETotalRec)
else
with FaceFile^ do
tmpByte:=trunc(GetPos*100/GetSize);
write(#13,tmpByte:2,' % ');
end;
procedure TMyReport.EndOfPage;
begin
write(' : Replace paper and strike any key');
ReadKey;
write(#13,Dup(40,' '));
end;
procedure TMyReport.Errors;
begin
if State and rfLongLin <> 0 then
writeln('DBW: Error - Line too long');
if State and rfLongCmd <> 0 then
writeln('DBW: Error - Command too long');
if State and rfBadNum <> 0 then
writeln('DBW: Error - Invalid numeric value');
if State and rfBadCmd <> 0 then
writeln('DBW: Error - Bad command');
if State and rfBadBuf <> 0 then
writeln('DBW: Error - No such buffer');
if State and rfDevice <> 0 then
writeln('DBW: Error - Destination device error');
if State and rfDBMS <> 0 then
writeln('DBW: Error - DB access error');
end;
procedure TMyReport.Warnings;
begin
if State and rfFile <> 0 then
writeln('DBW: Warning - Write into file');
if State and rfBoF <> 0 then
writeln('DBW: Warning - Begin of file');
if State and rfEoF <> 0 then
writeln('DBW: Warning - End of file');
if State and rfExit <> 0 then
writeln('DBW: Warning - User break');
end;
begin
writeln(Prompt);
if ParamCount <> 1 then
begin
writeln(BadParam);
Exit;
end;
Base:=New(PDefDBF,Init(1,ParamStr(1),'',0,NoUnique,Disable));
if DBInitError > ieExist then Exit;
Report:=New(PMyReport,Init(''));
with Report^ do
begin
SetParam(1,'',spPrinter);
CreateReport(1);
writeln(Ok);
Errors;
Warnings;
{ îÑΓ«ñ TMyReport.Warnings óóÑñÑ¡ ¿ß¬½ετ¿Γѽ∞¡« ó ñѼ«¡ßΓαᵿ«¡¡δσ
µÑ½∩σ, »α¿ »αá¬Γ¿τÑ߬«¼ ¿ß»«½∞º«óá¡¿¿ »α«úαá¼¼δ Ñú« µÑ½Ñß««íαạ«
¿ß¬½ετ¿Γ∞. }
Free;
end;
end.
ï¿ßΓ¿¡ú 2. Ä»¿ßá¡¿Ñ ¿¡ΓÑα∞Ñαá ñ½∩ »ÑτáΓ¿ DBF - íáºδ
é¡¿¼á¡¿Ñ!
é ßΓ᫬áσ 11 ¿ 13 ¿ß»«½∞ºπεΓß∩ π»αáó½∩εΘ¿Ñ ¬«ñδ »α¿¡ΓÑαá EPSON FX.
Åα¿ ¡Ñ«íσ«ñ¿¼«ßΓ¿ ߬«ααÑ¬Γ¿απ⌐ΓÑ ¿σ ¿½¿ πñ὿ΓÑ ¿º ΓѬßΓá ßΓ᫬¿ 11-13.
#Face1
#Height 60
#$27;S#$0
DBW v1.0 Copyright (c) 1994 "Shift" Software Laboratory, Tambov, Russia
#$27;T#$27;x#$1
#GoTop
# Repeat
DataBase: #Field 252;; Page #Page;
# Field 255;
# Field 254;
# Field 251;
# Repeat
# Field 253;
# Skip
# EPF
# Field 250;
# NewPage
# EoF
ï¿ßΓ¿¡ú 3. Ä»¿ßá¡¿Ñ ¿¡ΓÑα∞Ñαá ñ½∩ »ÑτáΓ¿ »½áΓѪ¡δσ »«απτÑ¡¿⌐
# Face1
# $27;M# $27;0
# Define ] = 2;# Define ` = 3;# Define R = 4;# Define ^ = 5
# Define F = 6;# Define [ = 7;# Define + = 8;# Define & = 9
# Define \ = 10;# Define W = 11;# Define @ = 12;# Define Y = 13
# Define * = 14;# Define } = 15;# Define $ = 16;# Define ? = 17
# Define ~ = 240
# ReadFld
ÅïÇÆàåìÄà ÅÄÉôùàìêà N #Field1; «Γ #Date DMY4E
│ 0401002 │
äàüàÆ │ æπ¼¼á │
┌───────────┬─────┴─────────┤
ŽáΓѽ∞Θ¿¬ ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] │ [[[[[[[[[ │ $$$$$$$$$$$$$ │
è«ñ ]]]]]]]]]]]]]]]]]]]]]] ┌───────────┤ │ │
üᡬ ```````````````````````````` │è«ñ ^^^^^^ │ +++++++++ │ │
```````````````````````````` │ │ │ │
RRRRRRRRRRRRRRRRRRRRRRRRRRRRR│ FFFFFF │ │ │
──────────────────────────────────┴───────────┤ èÉàäêÆ │ │
Å«½πτáΓѽ∞ &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ├───────────┼───────────────┤
è«ñ &&&&&&&&&&&&&&&&&&&&&& ┌───────────┤ ********* │ │
üᡬ \\\\\\\\\\\\\\\\\\\\\\\\\\\\ │è«ñ @@@@@@ │ │ │
\\\\\\\\\\\\\\\\\\\\\\\\\\\\ │ │ }}}}}}}}} │ │
WWWWWWWWWWWWWWWWWWWWWWWWWWWWW│ YYYYYY │ │ │
──────────────────────────────────┴───────────┴───────────┼───────────────┤
»«τΓ«⌐ ─ ΓѽÑúαáΣ«¼ ( ¡πª¡«Ñ »«ñτÑભπΓ∞ ) │ »Ñ¡∩ ºá ñ¡Ñ⌐│
│ ¿º % P. │
æπ¼¼á ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ├───────────────┤
»α«»¿ß∞ε ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ │ ßπ¼¼á ß »Ñ¡Ñ⌐ │
──────────────────────────────────────────────────────────┼──────┬────────┤
äáΓá »«½πτÑ¡¿∩ Γ«óáαá ¿ «¬áºá¡¿∩ πß½πú │ é¿ñ │ 01 │
──────────────────────────────────────────────────────────┤ «»Ñα.│ │
ìạáτÑ¡¿Ñ »½áΓѪá,¡á¿¼Ñ¡«óá¡¿Ñ Γ«óáαá,óδ»«½¡Ñ¡¡δσ αáí«Γ, ├──────┼────────┤
«¬áºá¡¡δσ πß½πú, NN ¿ ßπ¼¼δ Γ«óáα¡δσ ñ«¬π¼Ñ¡Γ«ó │ ìạ.│ │
│ »½áΓ.│ │
????????????????????????????????????????????????????????? ├──────┼────────┤
????????????????????????????????????????????????????????? │ æ᫬ │ │
????????????????????????????????????????????????????????? │ »½áΓ.│ │
├──────┼────────┤
│ ÄτÑα.│ │
│ N úα.│ │
│ íᡬá│ │
┌───────┐ └──────┴────────┘
│ î.Å. │ │ Åα«óÑñÑ¡« íᡬ«¼
└───────┘ Å«ñ»¿ß¿ ¬½¿Ñ¡Γá │ 19 ú.
│ Å«ñ»¿ß¿ íᡬá
#$27;2#$27;P