EndWhile

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: EndWhile

Post by MachineCode »

Tenaja wrote:When someone has a feature request that they feel important enough to post, and others rant about how lame the request is, it is very annoying. Especially when it is a backwards-compatible request that does not force a change upon people.
Changing "Wend" to "EndWhile" is backwards-compatible and doesn't force change? :shock: Of course it forces change. It means we'd ALL have to change our source codes because of the personal preference of one other single person. That's a good thing? No way.

As for such requests being annoying, then perhaps people shouldn't request stuff that is going to directly affect everyone else negatively. Changing core keywords because you don't like them is not a trivial thing. It's a major change to the language.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Re: EndWhile

Post by USCode »

MachineCode wrote:Changing "Wend" to "EndWhile" is backwards-compatible and doesn't force change? :shock: Of course it forces change. It means we'd ALL have to change our source codes because of the personal preference of one other single person. That's a good thing? No way.

As for such requests being annoying, then perhaps people shouldn't request stuff that is going to directly affect everyone else negatively. Changing core keywords because you don't like them is not a trivial thing. It's a major change to the language.
Please go back and carefully re-read my post:
USCode wrote:I'm not saying replace Wend, as it's already very well entrenched and in the BASIC tradition, but also allow EndWhile to be used to end a While loop as well.
Tough crowd around here! :wink:
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: EndWhile

Post by Tenaja »

Very first Line of This Thread wrote:For improved consistency, please consider adding EndWhile as a keyword to end a While loop.
...he didn't request a replacement for wend.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: EndWhile

Post by MachineCode »

I stand corrected. But if you don't want a replacement, then what's so bad about using your own macro?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: EndWhile

Post by Foz »

There is nothing wrong with using your own macro, just like there is nothing wrong with doing a CompilerIf for defining the correct New Line string for each OS.

The point is when you keep having to do it for every major and minor app, you have to ask - why can't it be built in?

Perhaps, another method would be a "pre-pender" in that you can add in all your own common Macros and CompilerIf statements and gets pulled in by the compiler each time.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: EndWhile

Post by MachineCode »

Foz wrote:The point is when you keep having to do it for every major and minor app, you have to ask - why can't it be built in?
Macros can be made part of a custom "Residents" file, so that they become part of the language set in the background and you don't need to type them in to every source. Problem solved! :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: EndWhile

Post by Demivec »

Foz wrote:There is nothing wrong with using your own macro, just like there is nothing wrong with doing a CompilerIf for defining the correct New Line string for each OS.

The point is when you keep having to do it for every major and minor app, you have to ask - why can't it be built in?

Perhaps, another method would be a "pre-pender" in that you can add in all your own common Macros and CompilerIf statements and gets pulled in by the compiler each time.
jaPBe allows aliases for commands. It can be set up so that when you type 'endwhile' it replaces it immediately with 'Wend'.

Not quite the same thing but useful to know.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: EndWhile

Post by Tenaja »

MachineCode wrote:Macros can be made part of a custom "Residents" file, so that they become part of the language set in the background and you don't need to type them in to every source. Problem solved! :)
...Until you paste that code into the forum and it causes errors for everyone else.

I like the idea, if it weren't for that. Perhaps an automatically generated header, and you can just insert an include file.
Post Reply