摘要
Visual basic随机文件记录含有汉字时,会发生读出记录不全的错误.究其原因,即记录的字段必须为定长的字符串,当写入或读出记录的长度少于定长的字符串长度时,会用空白来填充记录中后面的空间,用VB的内部函数RTrim或Trim都不能除掉这个空白.在此通过调用一个自定义函数,给出解决这一问题的方法.
When random files in Visual Basic contain Chinese characters, mistake named recorder read partially would occur. The reason for that can be attributed to the fact that the recorded field must be a fixed-length string, so when the length of the recorder in read-in or read-out process is less, further space left in the recorder will be fulfilled by blank content,VB's intrinsic function Rtrim or Trim both are unable to eliminate the blank. Therefore, this essay will introduce a method of transfering a self-defined function to cope with the problem.
出处
《杭州师范学院学报(自然科学版)》
CAS
2006年第6期448-450,共3页
Journal of Hangzhou Teachers College(Natural Science)
关键词
随机文件
汉字
记录
读取
random files
Chinese characters
recorder
read-out