|
| Blockwrite equivalent |
 |
Wed, 1 Nov 2006 09:49:53 -0600 |
Hi,
Does anyone know what Blockwrite() is doing? I need to rewrite this
function in C# .NET. Please help.
Thanks!
I
|
| Post Reply
|
| Re: Blockwrite equivalent |
 |
Wed, 1 Nov 2006 18:08:03 -0600 |
"I T" <tiongi@hotmail.com> wrote
> Does anyone know what Blockwrite() is doing?
Remember that programs usually use ReWrite(,)
Reset(,), Seek(), FileSize(), EOF(), and CloseFile()
together with BlockWrite(,,) and BlockRead(,,),
so you might want to consider the equivalent of each
|
| Post Reply
|
| Re: Blockwrite equivalent |
 |
Wed, 01 Nov 2006 20:51:02 +010 |
I T schrieb:
> Hi,
>
> Does anyone know what Blockwrite() is doing? I need to rewrite this
> function in C# .NET. Please help.
>
> Thanks!
> I
>
>
I only have the german description from TP Help. I hope its useful anyway.
------------
BlockWrite Prozedur
------------
Schreibt einen oder mehrere Records aus einer
Puffervariablen. f steht für eine untypisierte
Datei, buf für die Puffervariable. Count gibt
die Anzahl der zu schreibenden Records an, der
optionale Parameter result liefert die Anzahl
der tatsächlich geschriebenen Records zurück.
(count <> result --> Diskette voll). Maximal
können mit einem Aufruf von BlockWrite 64
KByte Daten geschrieben werden.
Syntax:
BlockWrite(var f: file; var buf; count: Word
var result: Word])
Siehe auch:
BlockRead
{ Example for BlockRead and BlockWrite }
program CopyFile;
{ Simple copy program w/NO error checking }
var
FromF, ToF: file;
NumRead, NumWritten: Word;
buf: array[1..2048] of Char;
begin
{ Open input file }
Assign(FromF, ParamStr(1));
{ Record size = 1 }
Reset(FromF, 1);
{ Open output file }
Assign(ToF, ParamStr(2));
{ Record size = 1 }
Rewrite(ToF, 1);
WriteLn('Copying ', FileSize(FromF),
' bytes...');
repeat
BlockRead(FromF,buf,
SizeOf(buf),NumRead);
BlockWrite(ToF,buf,NumRead,NumWritten);
until (NumRead = 0) or
(NumWritten <> NumRead);
Close(FromF);
Close(ToF);
|
| Post Reply
|
| Re: Blockwrite equivalent |
 |
Thu, 2 Nov 2006 09:49:05 +0200 |
Hello,
When porting an old TP application to Delphi, I re-wrote all logic by using
TFileStream instead. (I replaced BlockWrite with TFileStream's Write
method.)
So in .NET, I guess you can use FileStream.
> Does anyone know what Blockwrite() is doing? I need to rewrite this
> function in C# .NET. Please help.
Best regards,
Erik Lindberg
Localization specialist
http://www.multilizer.com/
|
| Post Reply
|
| Re: Blockwrite equivalent |
 |
Thu, 2 Nov 2006 14:14:53 -0600 |
Erik,
Is it possible to send me your Delphi code? It would be easier to translate
from Delphi to C#.
Thanks!
tiongi@hotmail.com
"Erik Lindberg" <erik.lindberg@multilizer.com> wrote in message
news:4549a2ec@newsgroups.borland.com...
> Hello,
>
> When porting an old TP application to Delphi, I re-wrote all logic by
> using TFileStream instead. (I replaced BlockWrite with TFileStream's Write
> method.)
> So in .NET, I guess you can use FileStream.
>
>> Does anyone know what Blockwrite() is doing? I need to rewrite this
>> function in C# .NET. Please help.
>
> Best regards,
> Erik Lindberg
> Localization specialist
> http://www.multilizer.com/
>
>
>
>
|
| Post Reply
|
|
|
|
|
|
|
|
|
|