Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for rexxout.rex

(view source code of rexxout.rex as plain text)

  1. /* Test: different ways to display messages */
  2.  
  3. /* Initialize RexxUtil */
  4. call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
  5. call SysLoadFuncs
  6. call SysCls
  7.  
  8. /* Send text directly to the console (CON) device */
  9. text = "Different ways to display messages"
  10. call SysCurPos 2,10
  11. call lineout "\DEV\CON", text
  12. text = "CON       Try to get rid of this message: even >NUL 2>&1 won't work"
  13. call SysCurPos 4,0
  14. call lineout "\DEV\CON", text
  15.  
  16. /* Send text tor standard error (STDERR) */
  17. call SysCurPos 6,0
  18. call lineout "\DEV\CON", "STDERR"
  19. text = "This message will disappear with 2>NUL or >NUL 2>&1"
  20. call SysCurPos 6,10
  21. call lineout STDERR, text
  22.  
  23. /* Send text to standard output */
  24. call SysCurPos 8,0
  25. call lineout "\DEV\CON", "STDOUT"
  26. text = "This message can be suppressed by >NUL but not by 2>NUL"
  27. call SysCurPos 8,10
  28. say text
  29.  

page last uploaded: 2017-08-21, 14:26