It is currently Wed May 27, 2020 1:01 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: [Not a bug] ExamineDesktops()
PostPosted: Tue Jun 13, 2017 1:29 pm 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
[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? :shock:

And yes, the "monitors" variable is local to that code (it's NOT global or set anywhere else).

Image


Last edited by Dude on Sun Sep 24, 2017 7:58 am, edited 5 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Tue Jun 13, 2017 4:51 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2469
Location: Germany
No problem her...

PB-Version ?
OS-Version ?

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 12:13 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
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).


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 9:17 am 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2336
Location: Berlin, Germany
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 10:51 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
Fluid Byte wrote:
Show us the whole code or a snippet that demonstrates the problem

I think my screenshot does that job quite nicely. No? The program flow and logic is there to see.


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 11:10 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3698
Location: Italy
Dude wrote:
I think my screenshot does that job quite nicely. No?


No.

Dude wrote:
ExamineDesktop() is in a thread


good lord of programmers hit him on the head ... I don't see any of that in the self-explanatory screenshot.

"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.

_________________
[ My little PureBasic review ]


Last edited by luis on Wed Jun 14, 2017 11:15 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 11:15 am 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 12:18 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3845
Location: Berlin, Germany
Dude wrote:
Fluid Byte wrote:
Show us the whole code or a snippet that demonstrates the problem

I think my screenshot does that job quite nicely. No?

No.

Dude wrote:
That's what this bug report is all about.

As already has been told you, this is not a serious bug report at all.

Fred 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.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: ExamineDesktops() must be called bug
PostPosted: Wed Jun 14, 2017 12:22 pm 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
Little John wrote:
As already has been told you, this is not a serious bug report at all.

Okay, forget it. I'll retract the report. Sorry for wasting everyone's time.


Last edited by Dude on Wed Jun 14, 2017 1:38 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: [Not a bug] ExamineDesktops()
PostPosted: Wed Jun 14, 2017 12:51 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3698
Location: Italy
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


Code:
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


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. :wink:

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: [Not a bug] ExamineDesktops()
PostPosted: Wed Jun 14, 2017 1:40 pm 
Offline
Addict
Addict

Joined: Mon Feb 16, 2015 2:49 pm
Posts: 1907
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Not a bug] ExamineDesktops()
PostPosted: Wed Jun 14, 2017 2:11 pm 
Offline
Addict
Addict

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3845
Location: Berlin, Germany
Dude wrote:
All I want to know, why does DesktopWidth() fail when ExamineDesktops() was just called before it?

And it seems that you are not the only one who wants to know that ...

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?

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye