递归火山软件开发平台

标题: 求VB6代码翻译成火山PC代码 [打印本页]

作者: Rongxian    时间: 2020-10-27 19:18
标题: 求VB6代码翻译成火山PC代码
本帖最后由 Rongxian 于 2020-10-28 19:02 编辑

Private Type stu
    num As Long
    age As Integer
    sex As String
End Type


Private Sub Command1_Click()
    Dim a() As stu
    For i = 0 To 5
        ReDim Preserve a(i)
        With a(i)
            .age = 12
            .num = i + 1
            .sex = "男"
        End With
    Next i
    Open App.Path & "\t.txt" For Random As #1
    For i = 0 To 5
        Put #1, , a(i)
    Next i
    Close #1
End Sub


Private Sub Command2_Click()
    Dim b As stu
    Open App.Path & "\t.txt" For Random As #1
    Get #1, Val(Text1.Text), b
    Close #1
    MsgBox b.age
End Sub






欢迎光临 递归火山软件开发平台 (https://bbs.voldp.com/) Powered by Discuz! X3.4