home *** CD-ROM | disk | FTP | other *** search
- /* Makes a WPS object out of the filename it receives as an argument. */
-
- isprg = 0
- isicon = 0
- isptr = 0
- isbmp = 0
- setup = ''
- parse arg filename
- filename = strip(filename)
- if filename \= '' then
- do
- call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
- call SysLoadFuncs
- rc = stream(filename,'c','query exists')
- if rc \= '' then
- do
- ext = right(rc,length(rc) - lastpos(".",rc))
- parse upper var ext ext
- if ext = 'EXE' then isprg = 1
- else if ext = 'COM' then isprg = 1
- else if ext = 'CMD' then isprg = 1
- else if ext = 'BAT' then isprg = 1
- else if ext = 'ICO' then isicon = 1
- else if ext = 'PTR' then isptr = 1
- else if ext = 'BMP' then isbmp = 1
- if isprg \= 0 then
- do
- /* create program objects for programs */
- setup = 'EXENAME='rc';PARAMETERS=%*'
- type = 'WPProgram'
- end
- else
- do
- /* create shadows for everything else */
- type = 'WPShadow'
- setup = 'SHADOWID='rc
- end
- title = right(rc,length(rc) - lastpos("\",rc))
- temp = left(title,lastpos(".",title) - 1)
- if temp \= '' then title = temp
- call SysCreateObject type,title,'<WP_DESKTOP>',setup,f
- end
- else
- say "Can't find "filename"."
- end
- else
- do
- say 'Usage: MAKEOBJ filename'
- say ' Creates a WPS object on the desktop for the filename.'
- say ' Excellent for drag and drop use.'
- end
-