题目内容
(11)建立一个通讯录的随机文件phonBook.txt,内容包括姓名、电话、地址和邮编,用文本框输入数据。单击“添加主记录”按钮Command1时,将文本框数据写入文件,单击“显示按钮”Command2时,将文本中所有内容显示在立即窗口。Private Type PerDate Name1 As String Phon As String*11 Address As String*10 PostCd As String*6 End Type定义PerData类型的变量xDataPrivate Sub Form_Click() Open"C:\PhonBook.txt"For Random As 1End SubPrivate Sub Command1_Click() xData.Name1=Text1.Text xData.Phon=Text2.Text __________=Text3.Text xData.PostCd=Text4.Text Put#1,1,xData Text1.Text="":Text2.Text="" Text3.Text="":Text4.Text=""End Sub Private Sub Command2_Click() Reno=Lof(1)/Len(xData) i=1 Do While i=reno Get#1,i,xData Debug.Print xData.Name1,______,xData.Address,xData.PostCd i=i+1 LoopEnd Sub
查看答案
搜索结果不匹配?点我反馈
更多问题