On 05 Apr 2012 22:37:10 GMT, "Evertjan."
[snip]
>> Why bother having a return value? alert() does not have one now.
>
>But it does, it defaults to not false, try it out.
I did with
alert(alert("Hi"));
I got an alert with "Hi" then one with "undefined". This was on IE 9.
All of my examples in this post were done under IE 9.
>There are no internal or defined functions without an implicit return
>value in javascript.
>
>Think it over, why should this crash?
>
>if (alert(1)) ...
It did not crash for me. I gave it an else clause, and that
clause was executed.
>>>var r = confirm('Are you quite certain?') // default;
>>>var r = confirm('Are you sure?','lan:default'); // default forced lang
>>>var r = confirm('Are you sure?','I am','No, I'm not');
>>>[these return true/false]
>>>
>>>var r = confirm('Are you sure?','I am','No, I'm not','Please
>>>explain'); var r = confirm('How much is 2+2?','7','4.2','2','Help
>>>me!'); [these return the string clicked,
>>>any number of choices>2, displayed vertically]
>>
>> I think that confirm() should be yes/no only. "confirm" means to
>> get OK or not and does not fit multiple choice. For multiple choice,
>> use something else. choose()?
>
>The powars are very conversative, If you let tham argue about a new name
>you loose valuable years.
ITYM "powers", "conservative", and "lose", but certainly
"conversative" will do. They will talk it to death.
>>>var r = prompt('How much is 2+2?'); // default
>>>var r = prompt('How much is 2+2?',lan:en-gb');
>>>var r = prompt('How much is 2+2?','Done','Don`t know');
>>>[these return the (perhaps empty) string entered or false]
>>
>> false for cancelling the prompt with close? What about null?
>
>Not backwards compatible.
But prompt() did return null for me.
>What do you mean by 'close'?
Clicking on the close button. That returns null for me as does
clicking on cancel.
>>>The arguments should be return any computed value.
>>
>> This does not parse. Do you mean that any value should be
>> returnable? I would stick with character. Process the value if you
>> need a different type.
>
>Sorry, "caracter", do you mean "string"?
Yes. Character data in the form of a string.
>
>>>alert(array),confirm(array),prompt(array),
>>>should be possible in all above cases.
>>
>> Good idea.
>>
>> There is one other thing. I want to be able to specify the
>> default button.
>
>One can never specify the default.
Yes, I can with message boxes for one.
>"Default" means "when not specified".
When not specified by the user, my specified choice will be made.
>> There is quite a difference between
>> Do you really want to print that report?
>> and
>> Do you really want to erase the entire database?
>> It might be fine to default the first one to yes, but it would be
>> horrible to do so for the second.
>
>Sorry, that is up to the script programmer,
>has nothing to do with my suggested improvements
It is a case of user-friendliness.
>> Yes, one can reverse the language, but then it often loses the
>
>"reverse the language" like Hebrew, written in a "reversed" direction?
>
>Perhaps you mean "reverse the question"
>in the sense of affirmative/negative?
As in reversing the question.
>> clarity
>> Do you mind erasing the entire database?
>> "Erasing the entire database? ... No! ... ... Oh, NO!"
>
>Perhaps "mind" as in "mind the child"?
No, as in "Do you if I smoke?"
>A good system has ample backups.
An even better system does not need them restored very often.
Sincerely,
Gene Wirchenko