Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11199
| From | "R.Wieser" <address@not.available> |
|---|---|
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: inline "End If" bug, was Re: Weird bug |
| Date | 2015-11-17 18:27 +0100 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <n2fo1m$aqd$1@speranza.aioe.org> (permalink) |
| References | <n2d78f$639$1@dont-email.me> <n2esui$616$1@speranza.aioe.org> <n2fc8p$aal$1@dont-email.me> <n2fjn0$uu9$1@speranza.aioe.org> <XnsA555B3EE5C6F5eejj99@194.109.6.166> |
Evertjan.
> The only bug here that was introduced in VBS is
> that the following is illogically allowed:
Please explain why its illogical. All I see is a method to terminate a
"then" before an line-end is encountered. It would definitily solve
Mayayana's initial problem:
x = x + 9: If x > 10 Then x = 10 *end if*: If x < 0 Then x = 0
That a line-end *can* be used to terminate a single-line "if" does not mean
it should be the *only* way to do it. :-)
> Correct is:
>
> If boolean Then statement Else statement
Nope. Its just how quite a few (but definitly not all!) languages have
defined it. It does not mean its the *only way* anyone may implement it in
his language.
I know of languages which use your above description and work as Mayayana
described (continuing after a "then" if no "else" is found, or after the
first command after the "else").
Ofcourse, several of those languages have "command grouping" commands and/or
symbols, making it again possible to have a "then" or "else" execute an
abitrary number of commands/equations. Just think of how C++ does it, using
"{" and "}" to group commands together.
VBS (and a number of other languages) do not have such command-grouping
symbols/commands/methods, so they needed to think of something else.
Regards,
Rudy Wieser
-- Origional message:
Evertjan. <exxjxw.hannivoort@inter.nl.net> schreef in berichtnieuws
XnsA555B3EE5C6F5eejj99@194.109.6.166...
> "R.Wieser" <address@not.available> wrote on 17 Nov 2015 in
> microsoft.public.scripting.vbscript:
>
> > Maybe the designer of the programming language saw something you (still)
> > have not .... :-)
>
> The only bug here that was introduced in VBS is
> that the following is illogically allowed:
>
> If boolean Then statement Else statement End If
>
> as the "End If" is only part of the multiline If,
> not used or needed in the inline If syntax.
>
> Correct is:
>
> If boolean Then statement Else statement
>
> It is said that years ago [2003??] MS did put in an exception
> for that error during an update and immediately sites
> like cnn.com came tumbling down, so they restored the error.
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-16 13:28 -0500
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-16 19:50 +0100
Re: Weird bug "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2015-11-16 15:28 -0500
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-16 16:13 -0500
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-16 22:57 +0100
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-16 18:10 -0500
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 01:20 +0100
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-16 21:11 -0500
Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 10:44 +0100
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 11:19 +0100
Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 11:31 +0100
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-17 09:06 -0500
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 15:24 +0100
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-17 10:35 -0500
Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 16:45 +0100
Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 17:13 +0100
inline "End If" bug, was Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 17:41 +0100
Re: inline "End If" bug, was Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 18:27 +0100
Re: inline "End If" bug, was Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 19:37 +0100
Edsger Wybe Dijkstra was: Re: inline "End If" bug, was Re: Weird bug "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-11-17 19:44 +0100
Re: inline "End If" bug, was Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 20:47 +0100
Re: Weird bug "Mayayana" <mayayana@invalid.nospam> - 2015-11-17 12:01 -0500
Re: Weird bug "R.Wieser" <address@not.available> - 2015-11-17 18:47 +0100
Re: Weird bug "R. Roesler" <worm.composter@nospam.arcornews.de> - 2015-11-19 13:12 +0100
csiph-web