RE: So weird!

  • From: "Homme, James" <james.homme@xxxxxxxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 27 Jul 2010 06:57:13 -0400

Jes,
You wrote a do statement, not a while statement.

Jim

Jim Homme,
Usability Services,
Phone: 412-544-1810. Skype: jim.homme
Internal recipients,  Read my accessibility blog. Discuss accessibility here. 
Accessibility Wiki: Breaking news and accessibility advice


-----Original Message-----
From: programmingblind-bounce@xxxxxxxxxxxxx 
[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jes
Sent: Tuesday, July 27, 2010 5:04 AM
To: programmingblind@xxxxxxxxxxxxx
Subject: Re: So weird!

Well, according to our book, the } //end while is essential. Otherwise the 
braces don't match and we get compilation syntax errors. The / / end while is 
only a comment to the programmer to say hey I've just completed my while 
statement.
but the right brace is crucial, according to Diane Zak. I am programming using 
the  c plus plus.


On Jul 27, 2010, at 4:52 AM, Delaunay Christophe wrote:

> Hi Jes,
> Sorry. I can't really figure out what your problem is. However, by
> reading the piece of pseudo-code you wrote, I noticed that braces are
> not balanced.
>
> The exact syntax of a do ... while statement is
>
> do { block_of_code; } chile ( expression );
>
> There should not be a closing brace after the "while (expression )".
>
> So, if I use this scheme to rewrite your sample, I would have written:
>
> do
> {
>       Block 1 of code;
>       Block 2 of code;
> }
> while ( (something != this) && (something != that) );
> return 0;
> } // end of main function
>
> In other words, you can notice that I did not report the "} //end while"
> line sinc it is the cause of a compilation error.
> HTH. Have a nice day. Chris D
>
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jes
> Sent: mardi 27 juillet 2010 10:32
> To: programmingblind@xxxxxxxxxxxxx
> Subject: So weird!
>
> I notice that sometimes when I am coding an algorithm, I'll put in a
> block of code that works rock solid every time it is executed. For
> example:
> do
> {
> Block 1 of code
> cblock 2 of code;
>
> }
> while (something != this && something != 'that');
>
> } //end while
> return 0;
> } //end of main function
> Then, for whatever reason, I'll type that exact set of instructions
> somewhere else, by hand, and it won't compile, but when I select the
> rock solid portion of code and copy it, the program compiles just fine.
> How strange. Is this just me? Sorry if I am confusing all you peepers to
> death!
> Jes
> __________
> View the list's information and change your settings at
> //www.freelists.org/list/programmingblind
>

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed.  If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it.  If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
 The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: