Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Ansi -iso > Re: Loop variab...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 8 Topic 162 of 215
Post > Topic >>

Re: Loop variables in ISO 7185

by frank@[EMAIL PROTECTED] Jun 28, 2005 at 06:41 PM

2metre <news55@[EMAIL PROTECTED]
> wrote:
> frank@[EMAIL PROTECTED]
 wrote:
>> 2metre <news55@[EMAIL PROTECTED]
> wrote:
>> 
>>>Can loop variables be VAR parameters?
>> 
>> No, not even value parameters.
>> 
>>>eg
>>>Does the following code conform to ISO7185?
>
> Its a code snippet - not an entire program!

Code snippets never conform to a Pascal standard. My point is that
all too often users send incomplete code omitting some relevant
information. I've gotten tired of this. If one expects free help,
one could at least bother to make a self-contained test case. BTW,
given a complete program I could just it run through GPC in ISO 7185
mode, and it will (most likely) tell me if it conforms.

>> - invalid loop counter (see above)
> Is it? The variable i is declared within the scope of the block. Or 
> isn't it? Which is the point of my original question.

Which I replied to above.

ISO requires a so called entire-variable for the loop counter. This
makes it easiest to guarantee correct for-loop semantics and to
produce efficient code. See the current thread "Current test version
of Chess 0.5" in c.l.p.misc where the same issue came up and other
people have provided comments as well.

Frank

-- 
Frank Heckenbach, frank@[EMAIL PROTECTED]
 http://fjf.gnu.de/
GnuPG and PGP keys:         http://fjf.gnu.de/plan
(7977168E)
Pascal code, BP CRT bugfix: http://fjf.gnu.de/programs.html
Free GNU Pascal Compiler:   http://www.gnu-pascal.de/
 




 8 Posts in Topic:
Loop variables in ISO 7185
2metre <news55@[EMAIL   2005-06-28 11:33:13 
Re: Loop variables in ISO 7185
frank@[EMAIL PROTECTED]   2005-06-28 14:33:53 
Re: Loop variables in ISO 7185
akarl <fusionfive@[EMA  2005-06-28 15:15:57 
Re: Loop variables in ISO 7185
2metre <news55@[EMAIL   2005-06-28 17:22:03 
Re: Loop variables in ISO 7185
frank@[EMAIL PROTECTED]   2005-06-28 18:41:08 
Re: Loop variables in ISO 7185
2metre <news55@[EMAIL   2005-06-29 11:34:52 
Re: Loop variables in ISO 7185
frank@[EMAIL PROTECTED]   2005-06-29 14:32:18 
Re: Loop variables in ISO 7185
2metre <news55@[EMAIL   2005-06-29 15:49:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:40:17 CDT 2008.