Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.maple > #835

Re: colon in loop

From Axel Vogt <&noreply@axelvogt.de>
Newsgroups comp.soft-sys.math.maple
Subject Re: colon in loop
Date 2013-10-18 11:45 +0200
Message-ID <bccebhF7rouU1@mid.individual.net> (permalink)
References <l3prpf$hdv$1@dont-email.me>

Show all headers | View raw


On 18.10.2013 01:27, John Harper wrote:
> The following Maple program 
> 
>> for x from 1 to 2 do
>>     y := x^2:       
>>     evalf(y^2);     
>> od;
> 
> gives this output:
> 
>                                    y := 1
> 
>                                      1.
> 
>                                    y := 4
> 
>                                      16.
> 
> I had thought that the colon after y := x^2 would prevent printing y := 1 
> and y := 4. What should I have done instead? 
> 

The following might do what you expect:

for
  <some code ...>

  print( evalf(y^2) ); # explicit output

  <some more code ...>
end do:                # using ":" prevents other output

Back to comp.soft-sys.math.maple | Previous | NextPrevious in thread | Find similar


Thread

colon in loop John Harper <john.harper@vuw.ac.nz> - 2013-10-18 12:27 +1300
  Re: colon in loop "Nasser M. Abbasi" <nma@12000.org> - 2013-10-17 18:46 -0500
  Re: colon in loop Axel Vogt <&noreply@axelvogt.de> - 2013-10-18 11:45 +0200

csiph-web