ExamineDesktops() error

Just starting out? Need help? Post your questions and find answers here.
User avatar
DigitalDreams
User
User
Posts: 18
Joined: Mon Oct 30, 2023 10:50 pm

ExamineDesktops() error

Post 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 ?
User avatar
DigitalDreams
User
User
Posts: 18
Joined: Mon Oct 30, 2023 10:50 pm

Re: ExamineDesktops() error

Post 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
User avatar
mk-soft
Always Here
Always Here
Posts: 6253
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: ExamineDesktops() error

Post by mk-soft »

Which OS and PB version.

Its works here ...

Please use code tags of forum
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
User avatar
DigitalDreams
User
User
Posts: 18
Joined: Mon Oct 30, 2023 10:50 pm

Re: ExamineDesktops() error

Post 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 ?
normeus
Enthusiast
Enthusiast
Posts: 472
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: ExamineDesktops() error

Post 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.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
User avatar
DigitalDreams
User
User
Posts: 18
Joined: Mon Oct 30, 2023 10:50 pm

Re: ExamineDesktops() error

Post 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
User avatar
DigitalDreams
User
User
Posts: 18
Joined: Mon Oct 30, 2023 10:50 pm

Re: ExamineDesktops() error

Post 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
BarryG
Addict
Addict
Posts: 4178
Joined: Thu Apr 18, 2019 8:17 am

Re: ExamineDesktops() error

Post 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
Post Reply