Do {
//ask user to input their details
} while (myairline !=10);
no
--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)
> Do {
> //ask user to input their details
> } while (myairline !=10);
JS ist case-sensitive. `do' instead of `Do' works OK.
Learn from this:
var i = 10;
do
{
alert(i);
}
while (--i);
PointedEars
do
alert('only once')
while (false);
Very useful!
Evertjan. wrote:
> Thomas 'PointedEars' Lahn wrote on 25 nov 2005 in comp.lang.javascript:
>> shannon wrote:
>>> Do {
>>> //ask user to input their details
>>> } while (myairline !=10);
>>
>> JS ist case-sensitive. `do' instead of `Do' works OK.
>> Learn from this:
>>
>> var i = 10;
>>
>> do
>> {
>> alert(i);
>> }
>> while (--i);
>
> do
> alert('only once')
> while (false);
>
> Very useful!
What are you talking about? The above loop will be executed exactly 10
times. And if you are referring to the condition: any while-condition
can be _literally_ inverted to an until-condition:
do
{
alert('as long as condition applies')
}
while (condition);
do
{
alert('until condition applies')
}
while (!condition);
PointedEars
Then why didn't you post script code this time? The code itself is
exactly the same.
When correcting yourself, you should reply to yourself.
Top-posting is *never* acceptable. Even when correcting oneself.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
>> do
>> alert('only once')
>> while (false);
>>
>> Very useful!
>
> What are you talking about?
Hi, Thomas, I was not referring to your code.
Just making a joke as such.
> Thomas 'PointedEars' Lahn said the following on 11/25/2005 4:46 PM:
>> [My previous posting containde pseudo-code, I wanted to post script code]
>
> Then why didn't you post script code this time?
I did, read again.
> The code itself is exactly the same.
It is not, read again.
> When correcting yourself, you should reply to yourself.
No, you should not. There are three prudent ways when this happens
(I think we agree that it should not happen in the first place.)
A) Supersede the article to be corrected so that the new article
will be posted and the old article be canceled automatically
by the news server because of the Supersedes header it contains,
specifying the old article via its Message-ID.
B) Cancel the old article and repost it. Virtually the same as A),
however it is supported by news servers that support the Cancel
control message and not the Supersedes header. (However, both
are specified in Son-of-RFC-1036, the quasi-standard Usenet is
based on.)
C) Reply to the erroneous article. Only necessary on very large
postings where little is to be corrected and a complete repost
would waste bandwidth. Since the advent of Usenet spam, there
should not be one _public_ news server or Web interface out
there that disregards Cancel control messages, even though they
are only part of the quasi-standard.
I did A), using my newsreader's built-in feature that works perfectly
since the old article was indeed canceled. What is your excuse?
> Top-posting is *never* acceptable. Even when correcting oneself.
I was _not_ top-posting, read again! And learn to understand the
concept of submitter's note, unless you want to make a complete
fool of yourself here.
PointedEars
this works for me:
do
{
details[myairline]=prompt("Enter details for Airline "+myairline);
myairline++;
}
while(myairline<10);
<snip>
> do
> {
> alert('as long as condition applies')
// But do it once even if the condition is initially false
> }
> while (condition);
<snip>
John
--
John Harris
Ahh yes, the brackets are in the second. Hmmm, condition is undefined.
>
>>When correcting yourself, you should reply to yourself.
>
>
> No, you should not. There are three prudent ways when this happens
> (I think we agree that it should not happen in the first place.)
>
> A) Supersede the article to be corrected so that the new article
> will be posted and the old article be canceled automatically
> by the news server because of the Supersedes header it contains,
> specifying the old article via its Message-ID.
Theory: A post will be cancelled when it is Superseded.
Reality: It doesn't happen that way.
> B) Cancel the old article and repost it. Virtually the same as A),
> however it is supported by news servers that support the Cancel
> control message and not the Supersedes header. (However, both
> are specified in Son-of-RFC-1036, the quasi-standard Usenet is
> based on.)
Theory: A post will be cancelled when it is Cancelled.
Reality: It doesn't happen that way.
> C) Reply to the erroneous article. Only necessary on very large
> postings where little is to be corrected and a complete repost
> would waste bandwidth. Since the advent of Usenet spam, there
> should not be one _public_ news server or Web interface out
> there that disregards Cancel control messages, even though they
> are only part of the quasi-standard.
C) Is the best option, even though you failed to realize it.
> I did A), using my newsreader's built-in feature that works perfectly
> since the old article was indeed canceled. What is your excuse?
It was cancelled? Then how do you suppose I read it? Are you saying I
have ESP? Yippeeeeeee.
BULLSHIT.
Theory: Thomas's warped view of the world.
Reality: You are wrong.
>
>>Top-posting is *never* acceptable. Even when correcting oneself.
>
>
> I was _not_ top-posting, read again!
You should learn what top-posting is.
Let me quote the wikipedia that you seem to be so fond of:
<quote cite="http://en.wikipedia.org/wiki/Top_posting">
Top-posting means replying to a message above the original message.
</quote>
Well guess what? The very first line of your post was new content. That
is top_posting you moron. Learn the difference.
> And learn to understand the concept of submitter's note,
> unless you want to make a complete fool of yourself here.
I have been attacked by a lot better than you, so take your best shot.
> PointedHead
Take your mistakes with a grain of salt like everybody else.
Lee - don't "give up" - it was simply to say that this exchange
contains abusive language which does nothing to assist a genuine
learning forum. There is a lot more to life than computers, and the
current computer languages. Common civilty has to be learned too, and
for some it may be something they never master.
> Lee wrote:
>> Paul said:
>> >
>> >Well, call me old-fashioned, but I don't think I like the sound of
>> >people who gratuitously term others 'morons'.
>> >We are all learning here, and how little you understand if all you are
>> >capable of is abusing people.
>>
>> I give up. Who are you talking to?
>> Please quote the significant part of posts that you respond to.
>
> Lee - don't "give up" - it was simply to say that this exchange [..]
What exchange?