On Apr 13 17:02 98, Johan Kohler of 5:7103/1 wrote:
JK> MSGID: 5:7103/1 0013a256
JK> Hi there
JK> Can someone please give me a clue as to why the unit below
JK> (in particular
JK> the Procedure READFORMAT) gives Error #100 when I run it.
JK> It plays
JK> a .Wav file but when it reaches the end the error occurs
JK> (See * below).
JK> The code was not originally written by me. I have UUENCODED
JK> one of the
JK> WAV files which result in the problem and have attached it
JK> below.
JK> Thanks in advance
JK> Johan
JK> PROCEDURE ReadFormat(var f:file);
JK> var
JK> str:string[4];
JK> chunksize:longint;
JK> BEGIN
JK> blockread(f,str[1],4);
Blockread str[1] = one byte? You are reading 4 bytes into it? Even if that
was technically legal you are still accessing past the end of the array.
Maybe something like blockread(f,@str[1],3);?
But whatever... You only need to read 3 bytes to get the string 'fmt' if you
are adding the length byte yourself.
JK> str[0]:=#4;
Isn't str a reserved word?
JK> if str='fmt ' then begin
Is that space after fmt sposed to be there? Then your array must be 5 bytes
long. If so then str:string[5]; might be more like it.
Doug
--- Msgedsq/2 3.05
---------------
* Origin: -=Tir na nOc=- (02)66245944 (3:626/667)
|