home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / vrexx_2.zip / TESTWIN.CMD < prev    next >
OS/2 REXX Batch file  |  1993-10-28  |  2KB  |  111 lines

  1. /* TESTWIN.CMD */
  2.  
  3. '@echo off'
  4. call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
  5. initcode = VInit()
  6. if initcode = 'ERROR' then signal CLEANUP
  7.  
  8. signal on failure name CLEANUP
  9. signal on halt name CLEANUP
  10. signal on syntax name CLEANUP
  11.  
  12. /* display the version number of VREXX */
  13.  
  14. ver = VGetVersion()
  15. msg.0 = 1
  16. msg.1 = 'VREXX version # ' ver
  17. call VMsgBox 'TESTWIN.CMD', msg, 1
  18.  
  19. /* open a window and draw some text */
  20.  
  21. win.left   = 20
  22. win.right  = 70
  23. win.top    = 80
  24. win.bottom = 40
  25. id = VOpenWindow('My VREXX Window', 'RED', win)
  26.  
  27. text.1 = 'This is a VREXX window, created with a call to VOpenWindow.'
  28. text.2 = 'The window currently has a title = My VREXX Window, and it'
  29. text.3 = 'has a red background, which can be changed by a call to the'
  30. text.4 = 'VBackColor function.  The font is 12 point Times Roman.'
  31.  
  32. call VForeColor id, 'WHITE'
  33. call VSetFont id, 'TIME', 12
  34.  
  35. x = 10
  36. y = 900
  37. do i = 1 to 4
  38.    call VSay id, x, y, text.i
  39.    y = y - 50
  40. end
  41.  
  42. /* now display a message box */
  43.  
  44. msg.0 = 2
  45. msg.1 = 'Press OK to change the window title, the'
  46. msg.2 = 'window background color, and the font...'
  47. call VMsgBox 'TESTWIN.CMD', msg, 1
  48.  
  49. /* change the title and background color */
  50.  
  51. call VSetTitle id, 'A New Title!'
  52. text.2 = 'The new window title = A New Title!, and it'
  53.  
  54. call VClearWindow id
  55. call VBackColor id, 'BLUE'
  56. text.3 = 'has a blue background, which can be changed by a call to the'
  57. call VForeColor id, 'WHITE'
  58.  
  59. /* change the font */
  60.  
  61. call VSetFont id, 'HELVB', 15
  62. text.4 = 'VBackColor function.  The font is now 15 point Helvetica Bold.'
  63.  
  64. /* redraw the text in the window */
  65.  
  66. x = 10
  67. y = 900
  68. do i = 1 to 4
  69.    call VSay id, x, y, text.i
  70.    y = y - 60
  71. end
  72.  
  73. /* now move and resize the window */
  74.  
  75. msg.0 = 3
  76. msg.1 = 'Now the window will be cleared and moved around'
  77. msg.2 = 'and resized using the VResize function.  Press'
  78. msg.3 = 'OK to continue...'
  79. call VMsgBox 'TESTWIN.CMD', msg, 1
  80.  
  81. call VClearWindow id
  82.  
  83. win.left   = 5
  84. win.right  = 15
  85. win.bottom = 80
  86. win.top    = 95
  87. call VResize id, win
  88.  
  89. do 8
  90.    win.left   = win.left   + 5
  91.    win.right  = win.right  + 10
  92.    win.top    = win.top    - 5
  93.    win.bottom = win.bottom - 10
  94.    call VResize id, win
  95. end
  96.  
  97. /* put up a message box */
  98.  
  99. msg.0 = 1
  100. msg.1 = 'Press Cancel to end...'
  101. call VMsgBox 'TESTWIN.CMD', msg, 2
  102.  
  103. call VCloseWindow id
  104.  
  105. /* end of CMD file */
  106.  
  107. CLEANUP:
  108.    call VExit
  109.  
  110. exit
  111.