PB的blob类型的坑

坑1:blob转成number时要用对类型转换函数

long biWidth

Fileseek(filebmp,biWidth_offset,FromBeginning!)
FileReadEx(filebmp,bread,biWidth_len)
//blob赋值给long
biWidth = long(bread)        //这里可以

int biBitCount

Fileseek(filebmp,biBitCount_offset,FromBeginning!)
FileReadEx(filebmp,bread,biBitCount_len)
biBitCount = integer(bread)        //这里用long搞了半天都是0.正常是1.用integer正常了。

坑2:char转blob注意encoding编码

如果用

string swrite

swrite = char(27)+char(42)

filewrite(fileprint,swrite)   //这样写在linemode的时候的确可以正常发送给打印机。哪怕它是双字节的。(可能文件默认是以encodingansi的模式打开的??没搞懂)

如果

blob bwrite

bwrite = blob(char(27)+char(42))这样写入就是双字节了。

bwrite = blob(char(27)+char(42),encodingansi!)就需要加encoding了。


坑3:blobedit必须准确指定类型。如  

blobedit(bbyte,1,biWidth/256)        //坑
blobedit(bbyte,1,byte(biWidth/256))        //正确

    

坑4:连续用了blob的串接后,blob越来越长。

for

for。。。

bwrite = bwrite + bbyte

bwrite = bwrite + bbyte

bwrite = bwrite + bbyte

next

filewrite(fileprint,bwrite)        //写出特别大的文件来。8k的bmp打印点阵864k

next

我加了一个初始化

blob blobnull

for 。。。

bwrite = blobnull                 //加了这个后正常

for。。。

bwrite = bwrite + bbyte

bwrite = bwrite + bbyte

bwrite = bwrite + bbyte

next

filewrite(fileprint,bwrite) 

next

推荐查看我的软件作品:

1. PB反编译大师

2. PB混淆加密大师

3. 互联网数据组件:DataWindowHTTP

4. ESC/POS打印组件:ESC/POS ImagePrint

5. SQLConnectManager:数据库连接断线管理(年后即将测试)

PB反编译, PB反编译大师, PB加密, PB混淆加密大师,DatawindowHTTP,PB DeCompiler,PB Obfuscator正在上传…重新上传取消http://powerbuilder.ltd/indexcn.htmlicon-default.png?t=M0H8http://powerbuilder.ltd/indexcn.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值