- 积分
- 4908
- 明经币
- 个
- 注册时间
- 2004-6-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2014-5-5 15:14:41
|
显示全部楼层
- ;;;------------------------------------------------------------------------------;;;
- ;;; SS:ReadBinaryStream V2.0 ;;;
- ;;;------------------------------------------------------------------------------;;;
- ;;
- ;; function : Read binarystream from file(full path) by given charset , return a List or a String .
- ;;
- ;; Args:
- ;; file -- file name with full path , The file size must be less than amount of memory can be used for the current AUTOCAD .
- ;;
- ;; char -- charset name , it must register in your system , see the Windows registry sub-key in [url=file://\\HKEY_CLASSES_ROOT\\MIME\\Database\\Charset]\\HKEY_CLASSES_ROOT\\MIME\\Database\\Charset[/url]
- ;; such as "unicode","ascii","us-ascii","chinese","GB2132", etc.
- ;; nil & "Unicode" , allways return a list like by vlisp function Read-char .
- ;; Oterwise , the char will be used to convert the stream into text string .
- ;;
- ;; pos -- position for start read byte , first start pos is 0 , second is 1,
- ;; for Bigfont-Char it maybe use two bytes , if so the second text start pos is 2 , 4 ... 2n .
- ;; len -- Numbits for read or readtext , if nil or beyond the size , will be set to suit Maximum value .
- ;;
- ;; Returns -- if char is nil or "Unicode" , returns a ascii code list ;after Acad2008 , The system expansion Charset beyond the 256 limit ,
- ;; so it may return number like 18760 ,for this case , you can use (rem 18760 256) to get the ascii code like old version .
- ;; if char is not nil and "Unicode" , and it's supported in your window system , returns a string .
- ;;
- ;; by GSLS(SS) 10.23-2011 ~
- ;;--------------------------------------------------------------------------;;
- ;; Refrence :
- ;; adodb.stream from [url=http://baike.baidu.com/link?url=HkCWIQo1pSmTMN76tTipNkSUR5O_s7_8ctpH_XXuo06y2qhd-TCAkCCuxDOtNi55zA5V9eTPO4fobMbeYDNjHK]http://baike.baidu.com/link?url=HkCWIQo1pSmTMN76tTipNkSUR5O_s7_8ctpH_XXuo06y2qhd-TCAkCCuxDOtNi55zA5V9eTPO4fobMbeYDNjHK[/url]
- ;; Microsoft Data Access Components
- ;; from [url=http://en.wikipedia.org/wiki/Microsoft_Data_Access_Components]http://en.wikipedia.org/wiki/Microsoft_Data_Access_Components[/url]
- ;; Nonsmall's from [url=http://bbs.mjtd.com/forum.php?mod=viewthread&tid=78782&extra=page%3D2%26filter%3Dtypeid%26typeid%3D110&page=1]http://bbs.mjtd.com/forum.php?mod=viewthread&tid=78782&extra=page%3D2%26filter%3Dtypeid%26typeid%3D110&page=1[/url]
- ;; Michale's from [url=http://www.theswamp.org/index.php?topic=17465.0]http://www.theswamp.org/index.php?topic=17465.0[/url]
- ;; LeeMac's from [url=http://www.theswamp.org/index.php?topic=39814.0]http://www.theswamp.org/index.php?topic=39814.0[/url]
- ;; Highflybird's from [url=http://www.theswamp.org/index.php?topic=36656.0]http://www.theswamp.org/index.php?topic=36656.0[/url]
- ;; this vbs can't run in my used case : ACAD2011 Win7 64Bit.
- ;; Thank you all a lot !
- ;;--------------------------------------------------------------------------;;
- ;; Method of Adodb.Stream object . ;;
- ;; Open , Close , Write , WriteText , Read , ReadText, ;;
- ;; Flush , CopyTo , Cancel , SkipLine, SetEOS ;;
- ;; Property of Adodb.Stream object . ;;
- ;; LineSeparator, SaveToFile, LoadFromFile , Charset , ;;
- ;; Size , Position , Type , State , Mode , EOS , ;;
- ;;--------------------------------------------------------------------------;;
- ;; e.g. (SS:ReadBinaryStream (findfile "gslsshp.shx") "us-ascii" 23 32) -->
- ;; "\032\010\000\010\000\001\000\010\000\022\000HELL\000\r\031^d\035z6q(`\000\000\000EOF"
- ;; (SS:ReadBinaryStream (findfile "gslsshp.shx") "Unicode" 23 4)--> '(18714 18824 18688 18824)
- ;; (SS:ReadBinaryStream (findfile "gslsshp.shx") nil 23 4)--> '(18714 18824 18688 18824)
复制代码 |
|