home *** CD-ROM | disk | FTP | other *** search
EPOC OPL Source | 1998-08-13 | 2.7 KB | 116 lines |
-
-
- APP GetPath, 268437310 REM Reserved id. Do not use for other apps
- CAPTION "GetPath", 1
- ICON "GetPath.mbm"
- ENDA
-
-
- REM TODO LIST
- rem
- rem
- rem
- rem
-
-
- INCLUDE "CONST.OPH"
- INCLUDE "SYSTEM.OXH"
-
- DECLARE EXTERNAL
- EXTERNAL CopyStringToClipBoard%:(PString$)
-
-
- PROC Main:
- LOCAL String$(255)
-
- String$ = OPENFILEDIALOG$:("C:\",0, 0, 0)
-
- String$ = """" + String$ + """"
-
- CopyStringToClipBoard%:(String$)
-
- gIPRINT "Path copied to clipboard", 0
-
- PAUSE 30
-
- rem--------------------------------------
- REM Need to display task list as GetPath
- REM returns to system screen when it closes
- rem--------------------------------------
-
- DISPLAYTASKLIST:
- ENDP
-
-
-
- PROC CopyStringToClipBoard%:(PString$)
-
- LOCAL FileHandle%
-
- LOCAL FileHeader1&
- LOCAL FileHeader2&
- LOCAL FileHeader3&
- LOCAL FileHeader4&
- LOCAL OffsetOfEndOfString&
- LOCAL LenghtOfString&
- LOCAL StringToClipBoard$(255)
- LOCAL FileTail1%
- LOCAL FileTail2&
- LOCAL FileTail3&
-
- rem--------------------------------------
- REM Replace old clipboard file or create it if not existing
- rem--------------------------------------
-
- IOOPEN(FileHandle%, "C:\System\Data\Clpboard.cbd", $302)
-
- rem--------------------------------------
- REM Write header to clipboard file 4 bytes at a time
- rem--------------------------------------
-
- FileHeader1& = &10000037
- FileHeader2& = &1000003B
- FileHeader3& = &0000000
- FileHeader4& = &4739D53B
-
- IOWRITE(FileHandle%, ADDR(FileHeader1&), 4)
- IOWRITE(FileHandle%, ADDR(FileHeader2&), 4)
- IOWRITE(FileHandle%, ADDR(FileHeader3&), 4)
- IOWRITE(FileHandle%, ADDR(FileHeader4&), 4)
-
- rem--------------------------------------
- REM Write string information to clipboard file
- rem--------------------------------------
-
- StringToClipBoard$ = PString$
-
- OffsetOfEndOfString& = &19 + LEN(StringToClipBoard$)
- LenghtOfString& = LEN(StringToClipBoard$)
-
- IOWRITE(FileHandle%, ADDR(OffsetOfEndOfString&), 4)
- IOWRITE(FileHandle%, ADDR(LenghtOfString&), 4)
-
- rem--------------------------------------
- REM Write string to clipboard file
- rem--------------------------------------
-
- IOWRITE(FileHandle%, ADDR(StringToClipBoard$) + 1, LEN(StringToClipBoard$))
-
- rem--------------------------------------
- REM Write closing bytes to clipboard file
- rem--------------------------------------
-
- FileTail1% = $0200
- FileTail2& = &10000033
- FileTail3& = &00000014
-
- IOWRITE(FileHandle%, ADDR(FileTail1%), 2)
- IOWRITE(FileHandle%, ADDR(FileTail2&), 4)
- IOWRITE(FileHandle%, ADDR(FileTail3&), 4)
-
- IOCLOSE(FileHandle%)
-
- ENDP
-
-
-