[Not a bug] ExamineDesktops()
[Not a bug] ExamineDesktops()
[Edit] Since I can't post my entire code, and the problem shown below is apparently no help, so don't worry about it.
This bug seems pretty self-explanatory. I just called ExamineDesktops(), and then DesktopWidth() is complaining that I didn't?
And yes, the "monitors" variable is local to that code (it's NOT global or set anywhere else).
This bug seems pretty self-explanatory. I just called ExamineDesktops(), and then DesktopWidth() is complaining that I didn't?
And yes, the "monitors" variable is local to that code (it's NOT global or set anywhere else).
Last edited by Dude on Sun Sep 24, 2017 7:58 am, edited 5 times in total.
Re: ExamineDesktops() must be called bug
No problem her...
PB-Version ?
OS-Version ?
PB-Version ?
OS-Version ?
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: ExamineDesktops() must be called bug
I have Windows 7 Ultimate (64-bit). Running PureBasic 5.60 (32-bit version), as shown in IDE status bar.
It doesn't happen all the time; just occasionally, so it's annoying. ExamineDesktop() is in a thread, and that's the ONLY place in the source where ExamineDesktops() is called; and thread safety is on.
I don't even know why the red error line is happening. DesktopWidth() should only be called if "monitors" is non-zero (ie. successful).
It doesn't happen all the time; just occasionally, so it's annoying. ExamineDesktop() is in a thread, and that's the ONLY place in the source where ExamineDesktops() is called; and thread safety is on.
I don't even know why the red error line is happening. DesktopWidth() should only be called if "monitors" is non-zero (ie. successful).
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: ExamineDesktops() must be called bug
Assumptions, nothing more. Show us the whole code or a snippet that demonstrates the problem, otherwise this discussion is pointless.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: ExamineDesktops() must be called bug
I think my screenshot does that job quite nicely. No? The program flow and logic is there to see.Fluid Byte wrote:Show us the whole code or a snippet that demonstrates the problem
Re: ExamineDesktops() must be called bug
No.Dude wrote: I think my screenshot does that job quite nicely. No?
good lord of programmers hit him on the head ... I don't see any of that in the self-explanatory screenshot.Dude wrote: ExamineDesktop() is in a thread
"thread" in the window is not enough to follow the code flow, also why one should manually copy some code to test it when he can paste it ?
Not to mention the code shown is just a piece of something, not something you can run.
Last edited by luis on Wed Jun 14, 2017 11:15 am, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: ExamineDesktops() must be called bug
Last time I checked, PureBasic was a top-down compiler... so if ExamineDesktops() appears a few lines before DesktopWidth(), as shown in my screenshot, then why is this error even occurring? That's what this bug report is all about.
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: ExamineDesktops() must be called bug
No.Dude wrote:I think my screenshot does that job quite nicely. No?Fluid Byte wrote:Show us the whole code or a snippet that demonstrates the problem
As already has been told you, this is not a serious bug report at all.Dude wrote:That's what this bug report is all about.
[u]Fred[/u] wrote:You will need to post full working snippet if you want us to look at a bug, because toying with an incomplete code is just waste of time as we don't even know if we meet the same conditions.
Re: ExamineDesktops() must be called bug
Okay, forget it. I'll retract the report. Sorry for wasting everyone's time.Little John wrote:As already has been told you, this is not a serious bug report at all.
Last edited by Dude on Wed Jun 14, 2017 1:38 pm, edited 1 time in total.
Re: [Not a bug] ExamineDesktops()
But Dude, you don't need to retract it, maybe it's a bug.
You just have to post some runnable code showing the problem, even if does not happen every time.
You have a big advantage in trying to do so compared to us, since you have some actual code where this is happening.
For example, this works for me
Anyway, if you tried to create a smaller code reproducing the problem and you didn't succeed then ok.
A "generic" heads up about a problem even it's not confirmed by others may still have some value for the developer who has access to the source code of those functions.
But you didn't say that.
You just have to post some runnable code showing the problem, even if does not happen every time.
You have a big advantage in trying to do so compared to us, since you have some actual code where this is happening.
For example, this works for me
Code: Select all
CompilerIf (#PB_Compiler_Thread = 0)
CompilerError "Please enable THREADSAFE in the compiler options"
CompilerEndIf
Procedure t (dummy)
d = ExamineDesktops()
If d = 0
Debug "ouch"
CallDebugger
EndIf
x = DesktopWidth(0)
y = DesktopHeight(0)
Debug x
EndProcedure
Procedure main()
h = CreateThread(@t(), 0)
WaitThread(h)
EndProcedure
For k = 1 To 1000
main()
Next
A "generic" heads up about a problem even it's not confirmed by others may still have some value for the developer who has access to the source code of those functions.
But you didn't say that.
"Have you tried turning it off and on again ?"
A little PureBasic review
A little PureBasic review
Re: [Not a bug] ExamineDesktops()
All I want to know, why does DesktopWidth() fail when ExamineDesktops() was just called before it? That's the "bug". That error should ONLY occur if ExamineDesktops() was NOT called first, right? But we can all plainly see from my screenshot that it WAS called, literally just a few lines prior. Not in another thread. Not elsewhere in my code. Doesn't make sense.
-
- Addict
- Posts: 4527
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: [Not a bug] ExamineDesktops()
And it seems that you are not the only one who wants to know that ...Dude wrote:All I want to know, why does DesktopWidth() fail when ExamineDesktops() was just called before it?
Anyway, just shouting "Bug!" doesn't give the answer. If you want to help us finding out the reason why, it is essential that we first can reproduce the issue! And this is especially important for the PB team for fixing the bug, BTW (in case this turns out to be actually a bug).
Make a copy of your program and remove all code that is not needed for reproducing the issue, until you have isolated the problem. Yes, it is a tedious process, but that's the only way. Me and many other people here have done so in the past dozens of times. So maybe you want to do so as well in order to get your answer, and perhaps also to contribute to improving PureBasic?