home *** CD-ROM | disk | FTP | other *** search
/ HomeWare 14 / HOMEWARE14.bin / os2 / cenv2_19.arj / CBPRINT.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-08  |  626b  |  21 lines

  1. EXTPROC CEnvi
  2. /**********************************************
  3.  *** CBPrint.cmd - Print contents of the    ***
  4.  *** ver.1         clipboard to the printer ***
  5.  **********************************************/
  6.  
  7. #include <ClipBrd.lib>
  8.  
  9. ClipText = GetClipboardData(CF_TEXT);
  10. if ( ClipText ) {
  11.    printf("Have clipboard text\n");
  12.    fp = fopen("\\DEV\\PRN","wt");
  13.    if ( fp ) {
  14.       fwrite(ClipText,strlen(ClipText),fp);
  15.       fclose(fp);
  16.       printf("Clipboard text has been sent to the printer.\n");
  17.    } else
  18.       printf("Error opening printer.\n");
  19. } else
  20.    printf("No text data in the clipboard.\n");
  21.