Page 1 of 1

ExamineDesktops() error

Posted: Tue Oct 31, 2023 3:55 pm
by DigitalDreams
If ExamineDesktops()
ScreenX = DesktopWidth(0)
ScreenY = DesktopHeight(0)
ScreenD = DesktopDepth(0)
ScreenF = DesktopFrequency(0)
EndIf

Debug ScreenX

Produces an error on the first line.....
[14:48:25] [ERROR] ExamineDesktops() must be called before another Desktop function.

Why is this when the If statement IS calling the procedure before the other functions ?

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:18 pm
by DigitalDreams
2nd version produces the same error on line 1 !

DeskNum=ExamineDesktops()

If DeskNum
ScreenX = DesktopWidth(0)
ScreenY = DesktopHeight(0)
ScreenD = DesktopDepth(0)
ScreenF = DesktopFrequency(0)
EndIf

Debug ScreenX

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:21 pm
by mk-soft
Which OS and PB version.

Its works here ...

Please use code tags of forum

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:24 pm
by DigitalDreams
mk-soft wrote: Tue Oct 31, 2023 4:21 pm Which OS and PB version.

Its works here ...

Please use code tags of forum
windows 10 22H2
PureBasic 6.03 LTS (Windows - x64)

Code tags ?

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:42 pm
by normeus
What OS are you using?
Version of PB?
Are you running a virtual machine?
Those are needed to answer your questions accurately.
This code is so basic that it should work. Unless you do not have a screen or your computer is infected with a virus.

Try this code

Code: Select all

Debug  ExamineDesktops()  ; is there at least 1 screen?
Debug  1+0 ; is debug even on? 

In a lighter note, I feel spam posts are getting help with artificial inteligence.

Code: Select all

If ExamineDesktops()
ScreenX = DesktopWidth(0)
ScreenY = DesktopHeight(0)
ScreenD = DesktopDepth(0)
ScreenF = DesktopFrequency(0)
EndIf

Debug ScreenX
debug d ;  <----------- this should not be 4 unless you assigned 4 to 'd' somewhere else. 
            ;   If you are not using 'd' anywhere why would you debug 'd'?



Norm.

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:50 pm
by DigitalDreams
normeus wrote: Tue Oct 31, 2023 4:42 pm What OS are you using?
Version of PB?
Are you running a virtual machine?
Those are needed to answer your questions accurately.
This code is so basic that it should work. Unless you do not have a screen or your computer is infected with a virus.

Try this code

Code: Select all

Debug  ExamineDesktops()  ; is there at least 1 screen?
Debug  1+0 ; is debug even on? 
Norm.
First line generates a 1 in debug screen
Second is the same...
NO virtual machines

Re: ExamineDesktops() error

Posted: Tue Oct 31, 2023 4:54 pm
by DigitalDreams
WEIRD

I closed PB completely and started a new program tab, now I get the debug result 3840 (4k Screen) !?

Something ran previously must have left things behind to confuse PB

Re: ExamineDesktops() error

Posted: Wed Nov 01, 2023 1:39 am
by BarryG
DigitalDreams wrote: Tue Oct 31, 2023 3:55 pm If ExamineDesktops()
ScreenX = DesktopWidth(0)
ScreenY = DesktopHeight(0)
ScreenD = DesktopDepth(0)
ScreenF = DesktopFrequency(0)
EndIf

Debug ScreenX

Produces an error on the first line.....
[14:48:25] [ERROR] ExamineDesktops() must be called before another Desktop function.

Why is this when the If statement IS calling the procedure before the other functions ?
Sounds like the same thing as this report -> viewtopic.php?p=508012