TIP: Click on subject to list as thread! ANSI
echo: pascal
to: ALEXEY BROUSHKOVSKY
from: DOUG BRENDISH
date: 1998-04-25 14:54:00
subject: WAV problem

On Apr 21 21:35 98, Alexey Broushkovsky of 2:4621/22.10 wrote:
AB> 20 Apr 98 12:15, Doug Brendish wrote to Johan Kohler:
JK>>> PROCEDURE ReadFormat(var f:file);
JK>>> var
JK>>> str:string[4];
JK>>> chunksize:longint;
JK>>> BEGIN
JK>>> blockread(f,str[1],4);
AB>                   ^^^^^^
DB>> Blockread str[1] = one byte? You are reading 4 bytes into 
DB>> it? Even if that was technically legal you are still 
DB>> accessing past the end of the array.
AB> Sorry about my long-distance intervence :)
You shouldn't do things you're going to be sorry for.
AB> Don't let me think bad about U!
Think whatever you like. I hear you're allowed to do that over there now. I 
know you won't stop me thinking whatever I like about you!:)
AB> Possible U're little kid which plays with Pa$cal..
Possibly I am, more likely you are considering the line above. But just to 
ease your mind I am 39 and have been 'playing' with pascal for about 8 years. 
AB> Everybody knows the simple compiler directive: {$R-} (BP&TP 
AB> have it).
His program did _not_ have range checking turned off. I suggest you go back 
and take a look. I would think using {$R-} instead of fixing the range errors 
is a stupid practice. You'd only be asking for problems.
The actual error was #100(string length mismatch). Or that was how I read it 
at the time. Looking back at it now it looks like runtime error #100(disk 
read error). Which would mean he was trying to read past the end of the wave 
file.
AB> and finally, BlockRead() uses str[1] as ADDRESS but not as 
AB> single byte ;(
Cool. I said I wan't sure if it was LEGAL to do it that way.
By the way... Where is your response to his message. I would have assumed you 
would have used your extensive knowledge of {$R-} to fix his program.
AB> Alexey Broushkovsky.
-->> BRUSH Laboratory Headquarter. Present day.
You're a cleaner? Figures.
Doug
--- Msgedsq/2 3.05
---------------
* Origin: -=Tir na nOc=- (02)66245944 (3:626/667)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.