请帮助我翻译此段vfp代码。谢谢

来源:百度知道 编辑:UC知道 时间:2024/05/28 14:53:35
public nReadCount ,bOnRead,bOMRInstalled

bOnRead=.F.
bCardInstalled=.F.
str_DeviceList = space(200)

nret = OMR_GetDeviceList(@str_DeviceList)
j=1
for i = 1 to len(str_Devicelist)
if(substr(str_DeviceList,i,1)=chr(0))
ThisForm.comboDevice.additem(substr(str_DeviceList,j,i-j))
exit
endif
if(substr(str_DeviceList,i,2)=chr(13)+chr(10))
ThisForm.comboDevice.additem(substr(str_DeviceList,j,i-j))
i = i+2
j = i
endif
endfor
bOMRInstalled = .f.

作用是在Combo框里面显示设备表,如显示器、打印机、CPU等。

public nReadCount ,bOnRead,bOMRInstalled

bOnRead=.F.
bCardInstalled=.F.
str_DeviceList = space(200)

nret = OMR_GetDeviceList(@str_DeviceList) &&提取设备列表
j=1
for i = 1 to len(str_Devicelist) &&开始提取
if(substr(str_DeviceList,i,1)=chr(0)) &&取到最后0,意思是文件结尾,结束继续提取设备名到Combo.
ThisForm.comboDevice.additem(substr(str_DeviceList,j,i-j))
exit
endif
if(substr(str_DeviceList,i,2)=chr(13)+chr(10)) &&以回车换行为标准提取设备名,看来这个设备表是txt文件.
ThisForm.comboDevice.additem(substr(str_DeviceList,j,i-j))
i = i+2
j = i
endif
endfor
bOMRInstalled = .f.