From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,932267eb02cfdff6,start X-Google-Attributes: gid103376,public From: Jeff Winchester Subject: raised Constraint_Error? Date: 1995/04/03 Message-ID: #1/1 X-Deja-AN: 100815555 organization: University of South Florida x-sender: winchest@babbage content-type: TEXT/PLAIN; charset=US-ASCII mime-version: 1.0 newsgroups: comp.lang.ada Date: 1995-04-03T00:00:00+00:00 List-Id: Could anyone tell me why the following code would cause a constraint error? I've been pulling out hairs for a couple of days now and am obviously overlooking something simple. Thanks. current := head; while current /= null loop if (current.name (current.nl)) = (sname (snl)) then current := current.next; if (current.class (current.cl)) = (sclass (scl)) then current := current.next; if (current.number = snumber) then current := current.next; pay := current.cost; text_io.put ("The test costs $"); flt_io.put (item => current.cost, aft => 2, exp => 0); text_io.put ("Please enter your payment --> $"); flt_io.get (pay); text_io.new_line; if pay < cost then pcost := cost - pay; text_io.put ("You didn't pay enough. You still owe $"); flt_io.put (item => pcost, aft => 2, exp => 0); elsif cost < pay then pcost := pay - cost; text_io.put ("Thank you. Your change is $"); flt_io.put (item => pcost, aft => 2, exp => 0); else current := current.next; end if; else current := current.next; end if; else current := current.next; end if; else current := current.next; end if; exit when current = null; end loop; end price; -------------------- or this one. . . . if lthis = 1 then text_io.new_line; text_io.put ("Please enter the class name --> "); text_io.get_line (lclass, lcl); text_io.skip_line; lcurrent := head; while lcurrent /= null loop if (lcurrent.class (lcurrent.cl)) = (lclass (lcl)) then text_io.put_line (lcurrent.name (1..lcurrent.nl)); text_io.put_line (lcurrent.class (1..lcurrent.cl)); int_io.put (lcurrent.number); text_io.new_line; int_io.put (lcurrent.quantity); text_io.new_line; flt_io.put (lcurrent.cost); text_io.new_line; int_io.put (lcurrent.pages); text_io.new_line; text_io.new_line; lcurrent := lcurrent.next; else lcurrent := lcurrent.next; end if; end loop; Very simple variable definitions--either string (1..35), integer, or float. That's not the problem, however. The linked lists seem to cause constrainst errors when searched, and I'm not sure why. any help would be appreciated--this is a last ditch effort for a programming class. Thanks. /--------------------------------------------------------\ | Jeff Winchester | PD Playhouse BBS | FidoNet 1:3635/40 | | [Team OS/2] | (813) 422-7391 | RGSNet 50:270/504 | |------------------------------------| EX-Net 80:200/10 | | Catering to the support of OS/2 | ITCNet 88:881/518 | | and the Renegade BBS software | | |--------------------------------------------------------| | CompuServe: 73404,2160 America Online: JeffW13680 | | Internet: winchest@babbage.csee.usf.edu | \--------------------------------------------------------/