Guidance
指路人
g.yi.org
Software / Reginald / Examples / zipexams / UnzipVars.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* This script shows how to use the RxUnzip add-on DLL to extract the
 * contents of a ZIP archive into REXX variables. NOTE: To create the
 * test archive, run the ZipVars.rex example.
 */

OPTIONS "C_CALL"

/* Register the RxUnzip add-on DLL */
LIBRARY rxunzip

/* Tell RxUnzip to raise SYNTAX condition for any failure with an Unzip function */
ziperr = "SYNTAX"
zipheading = 1

DO
	/* Open a ZIP archive named "MyTest.zip" on disk (in the current directory).
	 * Store the ZIP handle in a variable named "ZipHandle".
	 */
	unzipopen("ZipHandle", "MyTest.zip")

	/* Determine how many items are in the archive. */
	unzipfinditem(ziphandle, "Count")

	/* Unzip each item in the archive. */
	DO i = 1 TO count

		/* Set the next item as the current item, and get info on it. */
		unzipsetcurrentitem(ziphandle, "Info", i)

		SAY "Unzipping..." info.0

		/* Unzip the archive into a variable named "MyVar". */
		unzipgetitem(ziphandle, "MyVar", "MEMORY")

		/* Display the contents. */
		SAY myvar
	END

	/* We're done with our ZIP archive on disk, so just let the FINALLY section close it. */

	CATCH SYNTAX
		CONDITION('M')

	FINALLY
		/* Make sure any ZIP archive we opened above is closed. */
		IF EXISTS("ZIPHANDLE") THEN unzipclose(ziphandle)
END
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-6-14  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:49:38