----boundary-LibPST-iamunique-602327998_-_-
Content-type: text/plain
I tried it under BB 1.5. The result is that
it does not compile if i is a constant that is out of range.
It does compile if i is a variable, because the compiler does not know
the value of i in advance.
The compiler makes no attempts at guessing the values of a variable.
It issues a run-time check instead.
- JT
----- Original Message -----
From: "CFB Software" <info{([at]})nowhere.xy
To: "BlackBox Mailing List" <blackbox{([at]})nowhere.xy
Sent: Wednesday, October 10, 2007 5:56 AM
Subject: [BlackBox] - FW: [BlackBox] - Why does this compile?
> Oops! Of course I should have said:
>
> PROCEDURE Crash*;
> CONST i = -800;
> VAR a: ARRAY 4 OF REAL;
> BEGIN
> a[i]:= i
> END Crash;
>
>> -----Original Message-----
>> From: CFB Software [mailto:info{([at]})nowhere.xy>> Sent: Wednesday, 10 October 2007 12:09 PM
>> To: 'blackbox{([at]})nowhere.xy>> Subject: RE: [BlackBox] - Why does this compile?
>>
>>
>> PROCEDURE Crash*;
>> CONST i: -800;
>> VAR a: ARRAY 4 OF REAL;
>> BEGIN
>> a[i]:= i
>> END Crash;
>>
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-602327998_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5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