home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
ini2url.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-06-06
|
1KB
|
68 lines
/*** Explore INI file to URL object conversion ***/
parse arg inifile destination
if inifile = "" then
do
say "ini2url inifile [destination=<WP_DESKTOP>]"
return 0
end
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
if destination = "" then
do
destination = "<WP_DESKTOP>"
end
classname = "WebExplorer_Url"
setupheader = "LOCATOR="
keyword = "quicklist="
/*** read file into memory ***/
rc = stream(inifile, 'c', 'open read')
if rc \= "READY:" then
do
say "ini2url: cannot open" inifile
return 0
end
file.0 = 0
i = 0
do while lines(inifile)
i = i + 1
file.i = linein(inifile)
end
file.0 = i
rc = stream(inifile, 'c', 'close')
/*** look for "quicklist=" entry ***/
do i = 1 to file.0
if word(file.i, 1) = keyword then
do
title = strip(substr(file.i, length(keyword) + 1), 'leading')
i = i + 1
URL = strip(file.i, 'both')
say "title=[" || title || "]"
say "URL=[" || URL || "]"
setup = setupheader || URL || ";";
rc = SysCreateObject(classname, title, destination, setup, 'replace')
if rc then
do
say "successful"
end
end
end
return 0