Home | Reviews | GUIpedia | Forum | Fun500


agumaScreen modes n\' stuff
How do you tell what the current screen mode is?
2008-08-289:19 PM

ToddRe:Screen modes n\' stuff
Are you talking about it when you run a DOS program from a GUI it changes the screen mode and then when it returns the screen mode isn't changed?
2008-08-289:59 PM

agumaRe:Screen modes n\' stuff
no, just how do you tell whether it's in SCREEN 0 or SCREEN 12 or SCREEN 13 or any other screen mode? (In any point in the program) Like if you run a program that CHAINs to another program, how do you know if it changed to SCREEN 12 or if it just stayed in SCREEN 0? Sorry if that didn't clarify anything...:P
2008-08-2810:26 PM

ToddRe:Screen modes n\' stuff
Tell it whenever you CHAIN to another program, return to SCREEN 12 when it's done.
2008-08-2811:06 PM

JacobPalmRe:Screen modes n\' stuff
I've sometimes used this procedure to determine the current screen mode. [code] ' ScrSettings procedure. ' ' Gets the current Basic screen mode setting and width. ' ' Parameters: ' sMode - the current Basic screen mode. See the ' SCREEN statement for valid return values ' (0-13). ' sWidth - the current width of the display in ' characters. ' SUB ScrSettings (sMode AS INTEGER, sWidth AS INTEGER) ' ================================== ' Gets current Basic screen mode and width setting. ' ================================== DIM regs AS RegType regs.ax = &HF00 INTERRUPT &H10, regs, regs ' &H10 returns video ' information. sWidth = (regs.ax AND &HFF00) 256 ' High byte of AX (AH). sMode = regs.ax AND &HFF ' Low byte of AX (AL). SELECT CASE sMode ' Map MS-DOS video mode CASE 3 ' number to Basic screen sMode = 0 ' modes. CASE 4 sMode = 1 CASE 6 sMode = 2 CASE 13 sMode = 7 CASE 14 sMode = 8 CASE 15 sMode = 10 CASE 16 sMode = 9 CASE 17 sMode = 11 CASE 18 sMode = 12 CASE 19 sMode = 13 CASE ELSE sMode = 3 END SELECT END SUB [/code] It returns both the screen mode and the width in pixels. It doesn't return the height, though.
2008-08-2911:30 AM

agumaRe:Screen modes n\' stuff
THANK YOU! That was what I was looking for. :)
2008-08-295:50 PM

BASIC Programming Help


2021 Brandon Cornell