请教全局变量的定义和读写
在模块内定义个全局变量:Public CA(16) As Variant在From1里面:
For i = 1 To NumItems
If Not Errors(i) = 0 Then
MsgBox "AsyncReadComplete Item Clienthandle = " + Str$(ClientHandles(i)) + " FAILED. Error Code = " + Str$(Errors(i)), vbCritical
ElseIf ClientHandles(i) > 0 And ClientHandles(i) < 17 Then
If Qualities(i) = 192 Then
CA(i) = ItemValues(i)
txtReadVal.Item(ClientHandles(i) - 1).Text = ItemValues(i)
Else
txtReadVal.Item(ClientHandles(i) - 1).Text = GetQualityText(Qualities(i))
'txtReadVal.Item(ClientHandles(i) - 1).BackColor = &H8080FF
End If
Else
在If Qualities(i) = 192 Then处:CA(i) = ItemValues(i),txtReadVal.Item(ClientHandles(i) - 1).Text能够正常显示数据
用取值的语句:Text4.Text = CA(12) 数据为0,请教这是怎么回事儿?该怎么处理这个问题?