Hi,
i would like to have a setting for EnableExplicit in the compiler options and default compiler settings dialogs. Once selected, there would be no need to put the compiler directive at the top of each source code.
Best regards
Uwe
Global EnableExplicit
Global EnableExplicit
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
Re: Global EnableExplicit
But then when you post some code here, those without that
directive won't be able to compile your code unless they type
it manually -- every time. It'll cause inconvenience to others.
directive won't be able to compile your code unless they type
it manually -- every time. It'll cause inconvenience to others.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: Global EnableExplicit
Nope. EnableExplicit means you have to declare all variables before use.PB wrote:But then when you post some code here, those without that
directive won't be able to compile your code unless they type
it manually -- every time. It'll cause inconvenience to others.
When removing EnableExplicit, the code still runs, as everything is properly declared already.
Re: Global EnableExplicit
You're right. I wasn't thinking clearly due to my spam fight
still being on my mind. Time to have a beer and relax, I think.
still being on my mind. Time to have a beer and relax, I think.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.
Re: Global EnableExplicit
I would put +1 but do not know how.uwekel wrote:Hi,
i would like to have a setting for EnableExplicit in the compiler options and default compiler settings dialogs. Once selected, there would be no need to put the compiler directive at the top of each source code.
Best regards
Uwe

Re: Global EnableExplicit
+1 as well
There was a discussion about why there's a compiler directive instead of just natively using it. But I can't remember the reasons against it.
There was a discussion about why there's a compiler directive instead of just natively using it. But I can't remember the reasons against it.
- langinagel
- Enthusiast
- Posts: 131
- Joined: Fri Jan 28, 2005 11:53 pm
- Location: Germany
- Contact:
Re: Global EnableExplicit
Indifferent.
It is feasible but more effort for postings.
In case of bug test or other short *concept* scripts you have to fiddle on the compiler options.
It seems that you guys assume everyone is so professional on the style guide that every posting here would comply to Enableexplicit.
Congrats to you, keep on! But then the short line Enableexplicit should not bother you.
But there are enough amateurs like e,g, me that might post code that does not declare all variables. I would prefer to have your response as well.
It is feasible but more effort for postings.
In case of bug test or other short *concept* scripts you have to fiddle on the compiler options.
It seems that you guys assume everyone is so professional on the style guide that every posting here would comply to Enableexplicit.
Congrats to you, keep on! But then the short line Enableexplicit should not bother you.
But there are enough amateurs like e,g, me that might post code that does not declare all variables. I would prefer to have your response as well.
Re: Global EnableExplicit
Considering how many "help" posts could be solved with EnableExplicit, showing typos in variable names and so on, there's no reason not to use it, even for a 20 line code.
BUT, I'd like "local" counter variables as well. Explicit declaration has its merits, but not for "For" loops. Since the variable is reset anyway, it doesn't matter if it was declared before or not.
BUT, I'd like "local" counter variables as well. Explicit declaration has its merits, but not for "For" loops. Since the variable is reset anyway, it doesn't matter if it was declared before or not.
Code: Select all
Define i=20
For i=5 To 15
Debug i
Next
Debug i ;should be 20, not 15 (uhm, it's 16, but no idea why oO) or throw a "not defined" error if the first line wouldn't exist
Re: Global EnableExplicit
Guys...really???
Is this really such a big deal?
A tiny one line command needs to be added to your code...
Use it or don't...Don't make a big deal out of absolutely nothing.

Is this really such a big deal?
A tiny one line command needs to be added to your code...
Use it or don't...Don't make a big deal out of absolutely nothing.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.