REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Start a VIO session with a specific font size





 
/*                                                                    */
/* Sample program to start an OS/2 session or a DOS box with a        */
/* specific font size                                                 */
/*                                                                    */
/* Usage:                                                             */
/*                                                                    */
/*   StartVio {fontSize} {prog_parameter}                             */
/*                                                                    */
/* where:                                                             */
/*                                                                    */
/*   fontSize                                                         */
/*                                                                    */
/*     Font for the window in the format 'HHxWW'                      */
/*     where HH = font height as decimal value                        */
/*     and   WW = font width as decimal value                         */
/*     (def.: Use default font size)                                  */
/*                                                                    */
/*   prog_parameter                                                   */
/*                                                                    */
/*     Further parameter for the START command                        */
/*     (e.g /DOS to start a DOS box)                                  */
/*                                                                    */
/*                                                                    */
/*                                                                    */
/* Example:                                                           */
/*                                                                    */
/*   Start an OS/2 Session with a 14x8 Font                           */
/*                                                                    */
/*      StartVIO 14x8                                                 */
/*                                                                    */
/*   Start a DOS Box with a 10x6 Font                                 */
/*                                                                    */
/*      StartVIO 14x8 /DOS                                            */
/*                                                                    */
/*                                                                    */
/* History                                                            */
/*   10.07.1997 v1.00 /bs                                             */
/*     - initial release (for RXT&T v2.60)                            */
/*                                                                    */
/*                                                                    */
/* Note:                                                              */
/*   Change the value for the variable "FontMenuEntry" if you're not  */
/*   using a non-english version of OS/2!                             */
/*                                                                    */
/*                                                                    */
/* (c) 1996 Bernd Schemmer, Germany, EMail: 100104.613@compuserve.com */
/*                                                                    */

        /*  Warning:  The name of this key is language                */
        /*            dependent! For example in German OS/2           */
        /*            versions, the name of this key is               */
        /*            Schrif˜tartgröße...; in Spanish OS/2            */
        /*            version, it's Tamaqo del ˜font...! (The         */
        /*            name seems to be equal to the menu entry        */
        /*            for the popup menu.)                            */
        /* (see Font size for text (VIO) windows)                     */

  FontMenuEntry = '˜Font Size...'

                    /* process the parameter                          */
  parse arg thisArgs

  parse var thisArgs thisFont furtherArgs

  NewFontSize = ''
  OldFontSize = ''

  if thisFont <> '' then
  do
    parse var thisFont height 'x' width

    if datatype( height ) <> 'NUM' | datatype( width ) <> 'NUM' then
    do
      furtherArgs = thisArgs
    end /* if datatype( height ) <> 'NUM'  ... */
    else
    do
      NewFontSize = d2c( width ) || d2c( height )
    end /* else */

  end /* if thisFont <> '' then */

         /* load the necessary REXXUTIL function                      */
  if newFontSize <> '' then
  do
    call rxFuncAdd 'SysIni', 'REXXUTIL', 'SysIni'

         /* save the old font size                                    */
    oldFontSize =  SysIni( 'USER', 'Shield', FontMenuEntry )

    if oldFontSize = 'ERROR:' then
      oldFontSize = ''

         /* set the new font size                                     */
    call SysIni 'USER', 'Shield', FontMenuEntry, newFontSize

  end /* if newFontSize <> '' then */

         /* start a new OS/2 session or DOS window                    */
  '@start /win' furtherArgs


         /* restore the old font size or delete the font size entry   */
         /* if no font size entry was set                             */
  if newFontSize <> '' then
  do
    if oldFontSize <> '' then
      call SysIni 'USER', 'Shield', FontMenuEntry, oldFontSize
    else
      call SysIni 'USER', 'Shield', FontMenuEntry, 'DELETE:'
  end /* if newFontSize <> '' then */

exit

  

Inf-HTML End Run - Successful