Post by donnybowers on Jun 25, 2021 18:45:24 GMT -5
This program might be useful for customizing things for your own personal use. I don't know if this would give a remote user of RB the correct information. I suspect it wouldn't, but let me know if you find out it does. I have no way of testing this right now. It would be interesting to know if it will report the screen dimensions of remote users or only the screen dimensions of the server host machine.
I will be using the information this code produces for custom styling of personal programs as well as possibly CMS type back-end programs for doing admin stuff. (If I find out it works for remote users then I will probably build some version of code into most of my programs to customize my pages for users of various devices and computer monitors.)
Of course most of us know our screen dimensions, but this code could be handy for when you have to transfer your RB programs to a different machine or if you change your monitor. You could have this information built right into your programs so that they will adjust according to different screen dimensions.
I've only tested this code on one system which is a Linux Puppy called UPupFF+D, built from Ubuntu 32bit Focal Fossa (LTS 20.04), some Debian Bullseye/Buster components and Kernel 5.4.x 32-bit PAE. Please share how it works if you try it on your system.
I'm pretty sure similar code could be developed for the Windows version of RB.
I will be using the information this code produces for custom styling of personal programs as well as possibly CMS type back-end programs for doing admin stuff. (If I find out it works for remote users then I will probably build some version of code into most of my programs to customize my pages for users of various devices and computer monitors.)
Of course most of us know our screen dimensions, but this code could be handy for when you have to transfer your RB programs to a different machine or if you change your monitor. You could have this information built right into your programs so that they will adjust according to different screen dimensions.
I've only tested this code on one system which is a Linux Puppy called UPupFF+D, built from Ubuntu 32bit Focal Fossa (LTS 20.04), some Debian Bullseye/Buster components and Kernel 5.4.x 32-bit PAE. Please share how it works if you try it on your system.
I'm pretty sure similar code could be developed for the Windows version of RB.
'PUBLIC DOMAIN CODE
ender=0 : mode=1
temp$ = shell$("xdpyinfo | grep dimensions")
print "Step 1:"
print temp$
print "Step 2:"
length=len(temp$)
temp$=right$(temp$,length-17)
print temp$
print "Step 3:"
for i=1 to length
char$=mid$(temp$,i,1)
if char$="x" then char$="" : mode=2
if char$=" " then ender=1
if ender=1 then goto [skipper]
if mode=1 then width$=width$+char$
if mode=2 then height$=height$+char$
[skipper]
next i
print "Screen Width: ";width$
print "Screen Height: ";height$
'SAVE SCREEN WIDTH AND HEIGHT TO FILE
open "screen-dimensions.txt" for output as #1
print #1, width$
print #1, height$
close #1