我这里没有你所说的问题,以下是我试验的代码:- Dim SubstationDataGather_DataArray As SubstationDataGather_Type
- Private Sub CommandButton1_Click()
- Open "d:\Gather.dat" For Random As #1 Len = Len(SubstationDataGather_DataArray)
- Get #1, 1, SubstationDataGather_DataArray
- Close #1
- With SubstationDataGather_DataArray
- SubstationDataGatherList = Format(.Substation_Name, "@@@@@@@@@@@@@@@@@@@@") & " " & _
- Format(.Substation_Alias, "@@@@@@@@@@@@@@@@@@@@") & _
- Format(.HighTensionCable_SegmentNumber, "##") & " " & _
- Format(Val(.SumRb), "##.#####") & " " & _
- Format(Val(.SumXb), "##.#####")
- End With
- '向列表框1中添加数据项, 即把数据显示在列表框1中
- ListBox1.AddItem SubstationDataGatherList
- End SubPrivate Sub UserForm_Initialize()
- Open "d:\Gather.dat" For Random As #1 Len = Len(SubstationDataGather_DataArray)
- With SubstationDataGather_DataArray
- .Substation_Name = "2631变电所"
- .Substation_Alias = "2631"
- .HighTensionCable_SegmentNumber = 1
- .SumRb = 2.3333
- .SumXb = 2.3333
- End With
- Put #1, 1, SubstationDataGather_DataArray
- Close #1
- End Sub
|