你要说清楚一些,是要将内容存到LIST中去,还是想从LIST中将用户选择的内容读出?

解决方案 »

  1.   

    哦 ,我想他的意思是把文件里的一定格式的数据读到数组里,排序后列到LIST里,然后再写到文件里吧!我回家替你写吧!
      

  2.   

    根本不用读到数组中的,可以直接放到list列表中!
    Type tstudent
      name As String * 8
      chi As Integer
      math As Integer
      recno As String * 2
    End Type
    Dim rsd As tstudent
    Dim lastr As Integer
    Dim fn As String
    Dim fname As String
    fn = dt1.Value
    filen = FreeFile()
    rcl = Len(rsd)
    fname = App.Path & "\" & fn
    Open fname For Random As filen Len = rcl
    position = lastr + 1
    For i = 1 To position  //i 为文件记录号
    Get #filen, i, rsd
    list.additem rsd.name &space(2) &rsd.chi & space(2) &rsd.math & space(2) & rsd.recno  //向list中加入内容 space(integer)为加入空格
    next
    close #filen