Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!quiche!storm From: storm@cs.mcgill.ca (Marc WANDSCHNEIDER) Newsgroups: comp.lang.pascal Subject: WACKO happenings Message-ID: <1991Apr9.070604.21757@cs.mcgill.ca> Date: 9 Apr 91 07:06:04 GMT Sender: news@cs.mcgill.ca (Netnews Administrator) Organization: SOCS, McGill University, Montreal, Canada Lines: 53 I recently wrote a program that simulates a computer network sending messages back and forth using heaps, queues, and graphs for routing tables. I finally got the program working, but the results were kinda screwy. Alas, I sat there for a few hours ripping my hair out trying to figure out what was wrong with my program, and came to the conclusion there was none. Still the program did not work. I then took another look at the program: Program Simulator (etc...) Const etc. type etc.... Var ..... i: integer; ****** <------ *********** procedures/functions etc.... begin .... .... i:= 0; .... .... .... end. I then REMOVEd the line i: integer; from the var declarations, and the i:=0; line from the main program. Worked fine as soon as I did that. Anybody know what the hell just happened...? Logic says that it should MAKE no difference whatsoever that i is there or not, since it is used correctly. A friend suggested that there were stray pointers, but in PASCAL that shouldn't be a problem, and the compiler should take care or not allow this. Any *thoughtful* insight into this problem...? (Okay, so I'm getting a little sick of "gee, maybe your computer's broken" answers...) ./*- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storm@cs.mcgill.ca McGill University It's 11pm, do YOU Marc Wandschneider Montreal, CANADA know what time it is? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~