home *** CD-ROM | disk | FTP | other *** search
/ PSION CD 2 / PsionCDVol2.iso / Programs / 913 / Clipboard.SIS / Example.opl (.txt) < prev    next >
Encoding:
EPOC OPL Source  |  1999-08-29  |  1.6 KB  |  50 lines

  1.  
  2.  
  3. REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  4. REM !                                                     !
  5. REM !                    CLIPBOARD DEMO                   !
  6. REM !                                                     !
  7. REM !                  (c) 1999 M.O'Neill                 !
  8. REM !                                                     !
  9. REM !      http://www.i27.com      clipboard@i27.com      !
  10. REM !                                                     !
  11. REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  12.  
  13. REM **************************Start************************
  14. PROC start:
  15.     LOADM "D:\System\OPM\Clipboard.OPM"     REM load module
  16.     Main:
  17. ENDP
  18.  
  19. REM **************************Main*************************
  20. PROC Main:
  21.     LOCAL c$(255)
  22.     
  23. REM read the contents of the clipboard into c$...
  24.     c$=CBClipboardRead$:
  25.     IF LEN(c$)>253
  26.         PRINT "!!Text too long, cropped to fit string!!"
  27.         PRINT
  28.         c$=LEFT$(c$,253)
  29.     ENDIF
  30.     
  31. REM display the results...
  32.     PRINT "Clipboard contents:",CHR$(34)+c$+CHR$(34)
  33.     PRINT "Length of text:",LEN(c$),"characters"
  34.     PRINT
  35.     PRINT "Press any key to copy",CHR$(34)+"test copy"+CHR$(34),"to the clipboard"
  36.     PRINT
  37.     GET
  38.     
  39. REM write some text to the clipboard...
  40.     CBClipboardWrite:("test copy")
  41.     
  42. REM read clipboard again and finish
  43.     c$=CBClipboardRead$:
  44.     PRINT CHR$(34)+c$+CHR$(34),"copied to the clipboard,"
  45.     PRINT "go to WORD and press CTRL+V to see for yourself!"
  46.     GET
  47. ENDP
  48.  
  49.  
  50.