G-Day all

Don't know if anyone could use this, but I developed it 
and thought it might be useful.
Basically it let's you in 3 statements set the size of 
the RBase window -- with a litle forethought...

The 3 statements go like this:

SET VAR var_defaultsize TEXT = NULL
SET VAR var_scrminus INTEGER = 2
RUN setscrsize IN YOUR_APP.APX

or like this:

SET VAR var_defaultsize TEXT = '800,600'
SET VAR var_scrminus INTEGER = 0
RUN setscrsize IN YOUR_APP.APX

What each does is explained here:
var_defaultsize  --- is what you would set as your choice of what the
you always
                 --- want the size of the screen to be if all else
fails.
                 --- IF this is set to NULL  Then you will get a FULL
SCREEN
                 --- set as your default.. If users screen is 1280 by
960 then
                 --- it would set RBGSIZE to CENTER CENTER 1280 960
                 --- NOTE: you have to put a comma between your screen
size
                 --- choices...

var_scrminus     --- If you want the users screen to be basically 2
sizes smaller
                 --- by whatever resolution they have then set it to 2.
This way
                 --- it uses about the same amount of screen size
regardless of
                 --- the users settings. 
                 --- IF this is set to 0 and you don't have a default
set like
                 --- SET VAR var_defaultsize TEXT = NULL then it will
always
                 --- set the users screen size to FULL SCREEN.. whatever
the
                 --- users screen size is.

RUN setscrsize IN YOUR_APP.APX
                 --- I put YOUR_APP.APX so you could just copy the
COMMAND BLOCK
                 --- into your apx file and state what ever it's name
is.
                 --- Of course you could even copy it without the first
2 lines
                 --- and use the variables and code inline if you want.. 
                 --- FEEL FREE

OTHER NOTES:
                 --- There is the line CLEAR VAR vm% at the end of this
code so
                 --- it will clear all variables starting with vm
                 --- The two variables var_defaultsize, and var_scrminus
you 
                 --- have to clear.

                 --- DISCLAIMER -- 
                 --- I am not responcible for the results of this code
and such
                 --- in any manner...

                 --- I'm sure there might be some setting I have not
covered in
                 --- in this code. You can add them in if you need them.
                 --- ONE BIG NOTE.. is that I have this code set up for
users
                 --- who are not using resolutions less than 800,600...
this
                 --- is pretty much about the smallest most people would
go 
                 --- anyway.

Jim Limburg

$COMMAND
setscrsize
SET VAR vm_screensize = (CVAL('ScreenSize'))
SET VARIABLE vm_horiz TEXT = (SSUB(.vm_screensize,1))
SET VARIABLE vm_vert TEXT = (SSUB(.vm_screensize,2))
--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-
--    PROGRAM NAME: setscrsize command block
--
--          AUTHOR: Jim Limburg
--                  Tuftco Corporation
--                  2318 Holtzclaw Ave, Chattanooga, TN 37404
--                  Voice: 423-698-8601 Fax: 423-698-0842
--
--         PURPOSE: This will set the screen size to whatever the users
--                  default screen size. We can alter this by decreasing
--                  the settings by incrementing the variable
--                  var_ScrMinus. When var_ScrMinus is set at 0 then
--                  whatever rbase returns as it's screen size in the
--                  statement:
--                  SET VAR vm_screensize = (CVAL('ScreenSize'))
--                  which is in the code below, will be what the
settings
--                  for RBGSIZE will be set to. If var_ScrMinus is
--                  incremented up by 1 or 2 or 3 it will decrease the
--                  size of the default screen resolution for rbase.
--                  If you set var_scrminus to a setting that it cannot
--                  handle then it will default to FULL SCREEN.
--
--       IS RUN BY: IN CODE using a statement like so:
--                  SET VAR var_scrminus INTEGER = 0
--                  SET VAR var_defaultsize TEXT = '800,600'
--                  RUN setscrsize IN scrsize.rtc
--
--         RETURNS: SETS the RBase sessions screensize
--
--    Ver. Compat.: RBase6.5++ or whenever RBGSIZE command was
introduced
--
--    MODIFICATION HISTORY
--             Created:   8/28/2001
--
--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=--=+=-

IF var_scrminus > 0 THEN --Means that we are setting the size smaller
  --than what the users screen size is.
  SWITCH ( .vm_horiz )
    CASE '800'
      SET VAR vm_horiz = '800'
      SET VAR vm_vert = '600'
      SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert -- Stay at 800 x 600
      BREAK
    CASE '1024'
      SWITCH ( .var_scrminus )
        CASE 1
          SET VAR vm_horiz = '800'
          SET VAR vm_vert = '600'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert -- Stay at 800 x
600
          BREAK
        DEFAULT
          IF var_defaultsize IS NOT NULL THEN
            SET VARIABLE vm_horiz = (SSUB(.var_defaultsize,1))
            SET VARIABLE vm_vert = (SSUB(.var_defaultsize,2))
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ELSE
            --This sets it to whatever the present screen size is
            --Like using the FULL SCREEN RESTORE
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ENDIF
          BREAK
      ENDSW
      BREAK
    CASE '1152'
      SWITCH ( .var_scrminus )
        CASE 1
          *(Drop to a 1024 x 768 resolution)
          SET VAR vm_horiz = '1024'
          SET VAR vm_vert = '768'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          BREAK
        CASE 2
          SET VAR vm_horiz = '800'
          SET VAR vm_vert = '600'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert -- Stay at 800 x
600
          BREAK
        DEFAULT
          IF var_defaultsize IS NOT NULL THEN
            SET VARIABLE vm_horiz = (SSUB(.var_defaultsize,1))
            SET VARIABLE vm_vert = (SSUB(.var_defaultsize,2))
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ELSE
            --This sets it to whatever the present screen size is
            --Like using the FULL SCREEN RESTORE
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ENDIF
          BREAK
      ENDSW
      BREAK
    CASE '1280'
      SWITCH ( .var_scrminus )
        CASE 1
          *(Drop to a 1024 x 768 resolution)
          SET VAR vm_horiz = '1152'
          SET VAR vm_vert = '864'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          BREAK
        CASE 2
          *(Drop to a 1024 x 768 resolution)
          SET VAR vm_horiz = '1024'
          SET VAR vm_vert = '768'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          BREAK
        CASE 3
          SET VAR vm_horiz = '800'
          SET VAR vm_vert = '600'
          SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          BREAK
        DEFAULT
          IF var_defaultsize IS NOT NULL THEN
            SET VARIABLE vm_horiz = (SSUB(.var_defaultsize,1))
            SET VARIABLE vm_vert = (SSUB(.var_defaultsize,2))
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ELSE
            --This sets it to whatever the present screen size is
            --Like using the FULL SCREEN RESTORE
            SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
          ENDIF
          BREAK
      ENDSW
      BREAK
    DEFAULT
      IF var_defaultsize IS NOT NULL THEN
        SET VARIABLE vm_horiz = (SSUB(.var_defaultsize,1))
        SET VARIABLE vm_vert = (SSUB(.var_defaultsize,2))
        SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
      ELSE
        --This sets it to whatever the present screen size is
        --Like using the FULL SCREEN RESTORE
        SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
      ENDIF
      BREAK
  ENDSW
ELSE
  IF var_defaultsize IS NOT NULL THEN
    SET VARIABLE vm_horiz = (SSUB(.var_defaultsize,1))
    SET VARIABLE vm_vert = (SSUB(.var_defaultsize,2))
    SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
  ELSE
    --This sets it to whatever the present screen size is
    --Like using the FULL SCREEN RESTORE
    SET RBGSIZE CENTER CENTER &vm_horiz &vm_vert
  ENDIF
ENDIF
CLEAR VAR vm%
RETURN

Reply via email to