Instead of always reminding the user to apply a certain compiler switch:
CompilerIf #PB_Compiler_Thread = 0
MessageRequester("Warning","Without Threadsafe... this won't work!")
CompilerEndIf
If the program needs a switch to run properly, why can't the programmer just write:
#PB_Compiler_Thread = 1
or...
SetSwitch(#PB_Compiler_Thread, 1)
Program in correct switches
Program in correct switches
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Re: Program in correct switches
That will not solve your problem, but maybe this would be a better solution.
When the flag is not activated, the compiler stops in the line with a Syntax error, otherwise it compile correctly.
Maybe the Problem is,that when the "Switch" is not at the begin of you SoureCode, it must stop compiling and start from the beginning. Also maybe a Problem, when you activate and deactivate the switch at diffrent position in your source code.
Code: Select all
CompilerIf #PB_Compiler_Thread=0
(0/1) "please activate ThreadSave in the Compiler Options"
CompilerEndIf
Maybe the Problem is,that when the "Switch" is not at the begin of you SoureCode, it must stop compiling and start from the beginning. Also maybe a Problem, when you activate and deactivate the switch at diffrent position in your source code.
Re: Program in correct switches
There is CompilerError for that purpose:
blueb, this would be a tricky change, I think, because compile switches like /Unicode are currently passed to the pbcompiler commandline, so it "knows" all the switches before it even starts loading/parsing through your code.
Code: Select all
CompilerIf (Not #PB_Compiler_Unicode)
CompilerError "Please compile in Unicode mode"
CompilerEndIf
blueb, this would be a tricky change, I think, because compile switches like /Unicode are currently passed to the pbcompiler commandline, so it "knows" all the switches before it even starts loading/parsing through your code.
Re: Program in correct switches
Thanks kenmo.
It was only a small request... nothing important.
You're right, the compiler needs to know 'in advance' to reading and executing the code.
Basically, I was thinking that when a person places some code on the forum for other users...
If the compiler was not in the desired mode, it could be done in the code itself, rather than
forcing the user to activate the switches manually.
It was only a small request... nothing important.
You're right, the compiler needs to know 'in advance' to reading and executing the code.
Basically, I was thinking that when a person places some code on the forum for other users...
If the compiler was not in the desired mode, it could be done in the code itself, rather than
forcing the user to activate the switches manually.
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem