home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / arexx / ole1v10a.lha / OLE_System / rexx / netOLEprint.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-12-09  |  1.6 KB  |  72 lines

  1. /*
  2.  * netOLEprint.rexx
  3.  *
  4.  * USAGE: netOLEprint.rexx
  5.  *
  6.  * netOLEprint.rexx
  7.  *
  8.  * $(C): (1994, Rocco Coluccelli, Bologna)
  9.  * $VER: netOLEprint.rexx 1.00 (09.Dec.1994)
  10.  */
  11.  
  12. ADDRESS COMMAND
  13.  
  14. MAXLINE = 80
  15.  
  16. IF ~SHOW('P','OLE_DISPLAY') THEN
  17.     RUN '>NIL: Multiview iff/piano PORTNAME OLE_DISPLAY'
  18.  
  19. s1 = "I can do an improvement, just using some modules of the OLE System."
  20. s2 = "Using an utility like SYS:System/CMD,"
  21. s3 = "I redirect the print to a file into an assigned directory SPOOL:"
  22. CALL Print(s1 s2 s3)
  23. ADDRESS OLE_DISPLAY "OPEN NAME iff/TokenRing.1prt.2pc"
  24. ''SAY '-m -s120 -p90' s1
  25. ''SAY '-m -s140 -p120' s2 s3
  26.  
  27. ADDRESS OLE_DISPLAY "OPEN NAME iff/TokenRing.OLEprt.1"
  28. s1 = "Running in background, an OLE module will take that file"
  29. s2 = "to send it on the network during its' best moment."
  30. CALL Print(s1 s2,)
  31. ''SAY '-m -s150 -p90' s1 s2
  32. ADDRESS OLE_DISPLAY "OPEN NAME iff/TokenRing.OLEprt.2"
  33.  
  34. s1 = "In this way, my computer is free like having a printer"
  35. s2 = "directly connected to it."
  36. s3 = "At the same time, I spare my network an overload."
  37. CALL Print(s1 s2,)
  38. ''SAY '-m -s140 -p120' s1 s2
  39. ADDRESS OLE_DISPLAY "OPEN NAME iff/TokenRing.1prt.2pc"
  40. CALL Print(s3,)
  41. ''SAY '-m -s120 -p90' s3
  42.  
  43. EXIT 0
  44.  
  45.  
  46. /*
  47.  *    procedure to split text onto lines of MAXLINE characters length
  48.  */
  49. Print: PROCEDURE EXPOSE MAXLINE
  50.  
  51.     DO i = 1 TO ARG()
  52.  
  53.         line = ARG(i)
  54.         DO FOREVER
  55.  
  56.             IF LENGTH(line) <= MAXLINE THEN DO
  57.                 ECHO line
  58.                 LEAVE
  59.                 END
  60.  
  61.             pos = MAX(LASTPOS(' ',line,MAXLINE),POS(' ',line))
  62.             IF pos = 0 THEN DO
  63.                 ECHO line
  64.                 LEAVE
  65.                 END
  66.  
  67.             ECHO LEFT(line,pos); line = SUBSTR(line,pos + 1)
  68.         END
  69.     END
  70.  
  71. RETURN
  72.