The function uses DBs checklist for display modes to determinate the 'best' available screen resolution (Where 'best' is the resolution with the most pixels). It works in DBC & DBP and can be used in the init-part of any program to overwrite the display mode set by DB.
It allows to adapt your application to any available screen format (which can be helpfull when you develop on a 4:3 screen and the user uses a 16:9 display).
function SetBestScreen()
remstart
-----------------------------------------------------------------------------
(c) 2008 Attila
The function will look for the highest available reolution on the system
and set it. Highest is defined as highest number of pixels, ignoring the
color-depth.
the function will work in DBclassic and DBpro
-----------------------------------------------------------------------------
remend
perform checklist for display modes
mwi=640:mhi=480:mde=16
for t=1 to checklist quantity()
wi=checklist value a(t) :` Width
hi=checklist value b(t) :` Height
de=checklist value c(t) :` Depth
if (wi*hi) > (mwi*mhi)
mwi=wi
mhi=hi
mde=de
endif
next t
set display mode mwi,mhi,mde
endfunction