Posts: 346
Threads: 45
Joined: Jun 2024
Reputation:
32
10-25-2025, 11:25 PM
(This post was last modified: 10-25-2025, 11:26 PM by Unseen Machine.)
Again as with me it's kinda spurious to most but,
CONST ScrnW& = _Desktopwidth
and a few other ideas have led me to ask...is it possible? Worthwhile(above a shared variable or constantly refencing _destopwidth)?
Or am i just crazy?
john
Posts: 3,446
Threads: 376
Joined: Apr 2022
Reputation:
345
I think this would be a crazy idea, as _DeskTopWidth isn't set in stone like CONST is. Maybe on *your* system, it never changes, but on my setup I tend to have:
laptop at 2048 x 1200 resolution
TV at 4096 x 2400 resolution
second monitor at 1920 x 1024 resolution
So I can start a program on the laptop screen, then grab it with the mouse and drag it left/right to the next screen and... my original desktop width isn't my current desktop width. Since such a command is usually involved with scaling, by making it CONST, I've now doomed my program to never scale. It's too small to read on my tv and interact with. Too large to fit my second monitor.
It really just ruined the entire point of the command. Much better to:
Dim Shared As Long ScreenW
ScreenW = _DesktopWidth
Then, you can periodically check to see if that width has changed and respond to it properly inside the program.
Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
10-25-2025, 11:51 PM
(This post was last modified: 10-25-2025, 11:54 PM by bplus.)
I don't understand the question. Every QB64 coder that has been stung by the bug is crazy!
I dont like mixing functions with constants, too many bad memories, old programs still have color screwed up!
Whats a defo again?
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 346
Threads: 45
Joined: Jun 2024
Reputation:
32
10-26-2025, 12:01 AM
(This post was last modified: 10-26-2025, 12:02 AM by Unseen Machine.)
(10-25-2025, 11:41 PM)SMcNeill Wrote: I think this would be a crazy idea, as _DeskTopWidth isn't set in stone like CONST is. Maybe on *your* system, it never changes, but on my setup I tend to have:
laptop at 2048 x 1200 resolution
TV at 4096 x 2400 resolution
second monitor at 1920 x 1024 resolution
So I can start a program on the laptop screen, then grab it with the mouse and drag it left/right to the next screen and... my original desktop width isn't my current desktop width. Since such a command is usually involved with scaling, by making it CONST, I've now doomed my program to never scale. It's too small to read on my tv and interact with. Too large to fit my second monitor.
It really just ruined the entire point of the command. Much better to:
Dim Shared As Long ScreenW
ScreenW = _DesktopWidth
Then, you can periodically check to see if that width has changed and respond to it properly inside the program. So for you, when _DESKTOPWIDTH is called then...it depends on the screen your rendering on! Imagine you launched program on your small screen and then Alt Entered, moved it across to you tv/other panel and the screen you've moved it to has a different res...the initial width, height, aspect ratio etc would suddenly change! AND I agree it's a mess as this is not a problem i haven't encountered!
BUT my reasoning....IF Aspect ratio or pixel size is calibrated against a "i made it to work on this res" but you can support this...then(again for me its probably relevant only...) a custom Aspect Ratio and/or scale values may be useful...and apparently referencing CONST is twice as fast as referencing variables....and you know me FPS is KING!
Thanks
Unseen
@bplus : "DEFO" is short for definitely!
Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
You English mates!
If something is definite how can it be definite again? And where is that o coming from?
Sorry feeling a little peculiar tonight.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 346
Threads: 45
Joined: Jun 2024
Reputation:
32
10-26-2025, 12:26 AM
(This post was last modified: 10-26-2025, 12:27 AM by Unseen Machine.)
(10-26-2025, 12:15 AM)bplus Wrote: You English mates!
If something is definite how can it be definite again? And where is that o coming from?
Sorry feeling a little peculiar tonight. Just for @bplus This is how i actually talk
"Ello son, a'right?" "Whats good, anfing appenin?" "Shout me on the dog later as i gotta go me old mans then ill be down the rubber!"
And is only DEFINIATE when the program starts...as we have agreed, resolutions are variable and (again for me) Width/height/ratios etc ARE constant IN your system so why cant i assign a value from the DESKTOP values? Surely they themselves are constants?
Me
John
p.s
Quote:Sorry feeling a little peculiar tonight.
All good here bro! I got big love for you so dont stress! My best questions are when im half drunk!
John
Posts: 243
Threads: 15
Joined: Apr 2024
Reputation:
30
10-26-2025, 02:48 PM
(This post was last modified: 10-26-2025, 02:49 PM by ahenry3068.)
(10-26-2025, 12:26 AM)Unseen Machine Wrote: (10-26-2025, 12:15 AM)bplus Wrote: You English mates!
If something is definite how can it be definite again? And where is that o coming from?
Sorry feeling a little peculiar tonight. Just for @bplus This is how i actually talk
"Ello son, a'right?" "Whats good, anfing appenin?" "Shout me on the dog later as i gotta go me old mans then ill be down the rubber!"
And is only DEFINIATE when the program starts...as we have agreed, resolutions are variable and (again for me) Width/height/ratios etc ARE constant IN your system so why cant i assign a value from the DESKTOP values? Surely they themselves are constants?
Me
John
p.s
Quote:Sorry feeling a little peculiar tonight.
All good here bro! I got big love for you so dont stress! My best questions are when im half drunk!
John No the DESKTOP values ARE NOT constants. They may always be the same on your system but they have to be determined by the code at Run Time.
CONSTANT's in someones code must be known at COMPILE time. Any parameter that is system dependent or can change on the same system between program runs can NOT BE A CONSTANT ! .
Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
10-26-2025, 05:35 PM
(This post was last modified: 10-26-2025, 05:37 PM by bplus.)
Is a person crazy for having a wild idea, hell no! I just watched 4 part interview with R Feynman. Our best science breakthroughs come from wild ideas. It's when none of the old methods of understanding a process work that wild ideas need to be entertained.
Is setting a Constant for screen width set to _DeskTopWidth a crazy idea, no kinda sensible but it makes assumptions how a user sets up and uses their screen tools.
I wouldn't do that because my taskbar is sometimes on right side (more room horizontally than vertical).
I like access to task bar though I'm coming to appreciate the Windows button for dropdown "Task bar" functions.
Also quite sane for testing ideas at forums, sorry @Unseen Machine you will have try harder if you want a "crazy" diagnosis from me
Now if you want to know who I think might really be crazy... well enough said for now LOL!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
Posts: 616
Threads: 109
Joined: Apr 2022
Reputation:
45
10-26-2025, 06:06 PM
(This post was last modified: 10-26-2025, 06:10 PM by CharlieJV.)
Quote:...snip...
CONSTANT's in someones code must be known at COMPILE time. Any parameter that is system dependent or can change on the same system between program runs can NOT BE A CONSTANT ! .
Just a thought:
If I have a program that needs to remember the date and time when the program started, that is a CONSTANT for the specific run of that program.
The "run start date and time" value is different for every run, but it is constant within one run, and is never known at compile time.
Posts: 4,692
Threads: 222
Joined: Apr 2022
Reputation:
322
I agree a varaible can be called Constant and the keyword used if during a run, it remains unchanged.
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
|