Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Zip file lister


#definefunction listzip(zipfile, action)
	AddExtender("WWZIP34I.DLL")
	list = zUnZipFiles('t', zipfile, '*.*', '', '')
	if strsub(list, 1, 1) == 0
	   if strsub(list, strlen(list), 1) == @tab then list = strsub(list, 1, strlen(list)-1)
	   list = strreplace(list, 'OK%@tab%', @tab)
	   cnts = itemcount(list, @tab)
	   list = itemremove(cnts, list, @tab)
	   list = itemremove(1, list, @tab)
	   list = strreplace(list, @tab, '')
	   list = strreplace(list, 'testing: ', ':')
	   list = strreplace(list, '/', '\')
	   list = strsub(list, strindex(list, ':', 1, @fwdscan)+1, -1)
	   Ziplist = ''
	   for cnt = 1 to itemcount(list, ':') 
	      Ziplist = iteminsert(strtrim(itemextract(cnt, list, ':')), -1, Ziplist, @tab)
	   next
	
	   if strlower(action) == "select_files"
	      asklist = ziplist
	      Ziplist = askitemlist('Select Files to Extract', Asklist, @tab, @sorted, @multiple)
	   endif
	   if strlower(action) == "display_list" then askitemlist('Files in the archive', Ziplist, @tab, @sorted, @multiple)
	else
	   message("Error", "Impossibile to get a list of files in archive!")
	   Ziplist = "Error"
	endif
	return(Ziplist)       ;ziplist is the list of files OR "Error"
#EndFunction



Article ID:   W15001