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 2 of 8 Topic 162 of 215
Post > Topic >>

Re: Loop variables in ISO 7185

by frank@[EMAIL PROTECTED] Jun 28, 2005 at 02:33 PM

2metre <news55@[EMAIL PROTECTED]
> wrote:

> Can loop variables be VAR parameters?

No, not even value parameters.

> eg
> Does the following code conform to ISO7185?
>
> function 1func (var i:integer):integer;
> begin
>    if i>0 then
>    for i:= 0 to 10 do
>    begin
>      ...
>    end;
> end;
>
> function 2func:integer;
> var a:integer;
> begin
>    a:= 1;
>    2func:= 1func(a);
>    ...
> end;

No, for several reasons:

- program header missing

- main program missing

- function names cannot start with numbers

- invalid loop counter (see above)

- result of first function not assigned

- ... is no valid Pascal statement ;-)

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:42:57 CDT 2008.