home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOKAN 17
/
DOKAN17.iso
/
Progs
/
Pjv03dde.zip
/
PJV03DDE
/
SRCCODE
/
SAMPLE2
/
EUC2SJS.DPR
Wrap
Text File
|
1999-06-18
|
2KB
|
69 lines
program euc2sjs;
// Pulsar EUC2SJS Source Code (c)1999 Pulsar Studio, & Lord Trancos.
// Please distribute the source code without any modification.
// FREEWARE
{$apptype console}
uses SysUtils, Nihongo in '..\MAIN\nihongo.pas';
const TXT00 = 'PULSAR EUC2SJS v0.3a (freeware)'+#10+
'(c)1999 Pulsar Studio.'+#10+
'Developed by Lord Trancos.'+#10;
TXT01 = 'USAGE: EUC2SJS inputfilename.euc outputfilename.sjs'+#10;
TXT02 = 'Converting...';
TXT03 = ' done!';
ERR00 = 'Can not open/creat file: ';
var srcfn, dstfn : string;
srcf, dstf : TEXT;
s, fn, ext : string;
begin
// Main title
Writeln(TXT00);
// Check param
if paramcount = 0 then begin writeln(TXT01); halt; end;
srcfn := paramstr(1);
if paramcount > 1
then dstfn := paramstr(2)
else begin
fn := paramstr(1);
ext := ExtractFileExt(paramstr(1));
SetLength(fn, Length(fn) - Length(ext));
dstfn := fn + '.SJS';
end;
// Open source
Assign(srcf, srcfn);
{$I-}
FileMode:=0;
Reset(srcf);
{$I+}
if (IOResult <> 0) then begin writeln(ERR00 + srcfn); halt; end;
// Create Dest
Assign(dstf, dstfn);
{$I-}
FileMode:=2;
ReWrite(dstf);
{$I+}
if (IOResult <> 0) then begin writeln(ERR00 + dstfn); halt; end;
// Do the job
Write(TXT02);
while not EOF(srcf) do
begin
Readln(srcf, s);
Writeln(dstf, jEUC2SJS(s));
end;
Writeln(TXT03);
// Close files
CloseFile(dstf);
CloseFile(srcf);
end.