Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.maple > #1308
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "Nasser M. Abbasi" <nma@12000.org> |
| Newsgroups | comp.soft-sys.math.maple |
| Subject | Re: colon vs semicolon in loops |
| Date | Mon, 18 Jun 2018 06:55:30 -0500 |
| Organization | Aioe.org NNTP Server |
| Lines | 44 |
| Message-ID | <pg86jg$9mc$1@gioia.aioe.org> (permalink) |
| References | <19de560e-34c7-45ff-88eb-d676b4b2023c@googlegroups.com> |
| Reply-To | nma@12000.org |
| NNTP-Posting-Host | G2uLfO5bcFe5XEkB0XsC5A.user.gioia.aioe.org |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Complaints-To | abuse@aioe.org |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
| X-Notice | Filtered by postfilter v. 0.8.3 |
| Content-Language | en-US |
| Xref | csiph.com comp.soft-sys.math.maple:1308 |
Show key headers only | View raw
On 6/17/2018 8:36 PM, jfh wrote:
> How does one get Maple to display some but not all of the results in a loop? The Maple output below displays everything done in a loop ending "end if;" and nothing done in a loop ending "end if:" but one of the two commands inside each loop ends with ":" and the other with ";". I know the output is what my program asked for but it's not what I had hoped for.
>
> |\^/| Maple 2017 (X86 64 LINUX)
> ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2017
> \ MAPLE / All rights reserved. Maple is a trademark of
> <____ ____> Waterloo Maple Inc.
> | Type ? for help.
> # test : vs ; in loops
>>
>> for n from 1 to 2 do
>> n:
>> n^2;
>> end do:
>>
>> for n from 1 to 2 do
>> n:
>> n^3;
>> end do;
> 1
>
> 1
>
> 2
>
> 8
>
as far as I know, it is not possible to do what you want.
I'd use a ":" for the "end do:" and then use ":" inside
the loop for the ones you do not want echoed to screen,
and for the ones you want to see, use an explicit print() on them.
for n from 1 to 2 do
n:
print(n^3);
od:
1
8
--Nasser
Back to comp.soft-sys.math.maple | Previous | Next — Previous in thread | Next in thread | Find similar
colon vs semicolon in loops jfh <john.harper@vuw.ac.nz> - 2018-06-17 18:36 -0700
Re: colon vs semicolon in loops "Nasser M. Abbasi" <nma@12000.org> - 2018-06-18 06:55 -0500
Re: colon vs semicolon in loops jfh <john.harper@vuw.ac.nz> - 2018-06-18 16:27 -0700
csiph-web