PDA

View Full Version : Get Current ScreenMode?



Raveen Ryan Sundram
27-Jun-2005, 12:01 AM
Hi,

Is there a way to get the current screeenmode?

Its before we use SHOW to display a message at screenxy 24 0 for the user,
and sometime we change the screenmode to RED for warning messages - we need
to save the current screnmode or color, so that we can restore it

Any ideas?

--
Regards,
Raveen Ryan Sundram
Excellent Software Ltd

Vincent Oorsprong
27-Jun-2005, 01:03 AM
Raveen,

I think that the command Get_Current_Colors do what you want to know.

--
Kind Regards,
Vincent Oorsprong
Data Access Europe BV
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
http://www.dataaccess.nl

Roger Loftus
27-Jun-2005, 12:41 PM
Raveen Ryan Sundram wrote:

> Hi,
>
> Is there a way to get the current screeenmode?
>
> Its before we use SHOW to display a message at screenxy 24 0 for the
> user, and sometime we change the screenmode to RED for warning
> messages - we need to save the current screnmode or color, so that we
> can restore it
>
> Any ideas?

Raveen:

The variable |VI34 should contain the current screenmode. As an
option, you can perserve the screenmode by moving |VI34 to an integer
variable, and then restoring it by the command 'Screenmode variable.

Roger Loftus

Raveen Ryan Sundram
29-Jun-2005, 03:48 PM
Vincent/Roger,

Thanks - both methods work.

See Test Code:
=====================================
string pause
integer iFg iBg ix

for ix from 28 to 32
Screenmode ix
Gosub Show_Color_Code
Loop
inkey pause
Abort

Show_Color_Code:
get_current_colors to iFg iBg
showln 'CurntColor=' iFg ',' iBg
showln 'ScreenMode=' (Low(|VI34)) ',' (Hi(|VI34))
showln
Return

Results/Output:
=====================================
CurntColor=28,31
ScreenMode=28,2

CurntColor=29,31
ScreenMode=29,2

CurntColor=30,31
ScreenMode=30,2

CurntColor=31,31
ScreenMode=31,2

CurntColor=32,31
ScreenMode=32,2
=====================================

Regards,
Raveen Ryan Sundram
Excellent Software Ltd