从二进制字符串中读取一个数值

int getv(int bs,int pos,int type);
//bs:二进制字符串的句柄值
//pos: 获取数据的位置,第一个字符位置为0,需要小于系统规定的字符串长度,一般系统定义1024
//type:数值的类型: 1-表示一个字节(byte)  2-表示两个字节(word)  4-表示一个长整数(long int)
//返回值,int

示例

int bs;
bs=newbin(256);

//写一个数据
setv(bs,3,65534,2);   //第二个字节写0xfe 0xff
echo(getv(bs,3,1)); //显示254(0xfe)

注意