Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!bsu-cs!shepard From: shepard@bsu-cs.bsu.edu (Brett Shepard) Newsgroups: comp.lang.pascal Subject: TP 5.5 - weird error Keywords: integers not adding correctly Message-ID: <11281@bsu-cs.bsu.edu> Date: 7 Jun 90 05:01:21 GMT Organization: CS Dept, Ball St U, Muncie, IN, USA Lines: 42 HELP!!! I've written to following code (in Turbo Pascal 5.5), which makes sense to me, but fails to execute. A trip through the debugger (Turbo Debugger 1.0) has shown me the error, but I can't figure out why I'm getting the error. Var FDT, I : Integer; Begin FDT := 1; For I := 1 to 2 do For S := H to C do { S in an enumerated type - H, D, S, C} For P := 1 to 14 do { P is an enumerated type - 1..14} Begin FD[FDT].P := P; FD[FDT].S := S; Inc(FDT); End; { for P } End; {procedure } The problem occurs when FDT reaches 107 (6Bh), after the next time through the Inc() statement, FDT is set to 11 (Bh). Thinking that the error, for some strange reason, might be in the Inc() procedure, I changed the line to read: FDT := FDT + 1; that didn't make any difference, the value still went from 107 to 11. I am totally confused by these proceedings and would greatly appreciate _any_ comments or assistance. Thanks, Brett BTW - please e-mail. I don't get to read this group very often. Thanks. ------------------------------------------------------------------------------- "Just the opinions, ma'am." | Brett Shepard | Close your eyes and Go ahead, crash our system! | Ball State University | pretend that there is UUCP: shepard@bsu-cs.bsu.edu| Muncie, IN | a fancy graphic here -------------------------------------------------------------------------------