将vb程序计算的结果存入txt文本文件中 :按附图的格式来写,就是我让它在哪个输出结果后换行就在哪换
按附图的格式来写(输出结果有三四十个,我要分开类)1。首行输出居中显示2。就是我让它在哪个输出结果后换行就在哪换。...
按附图的格式来写(输出结果有三四十个,我要分开类)
1。首行输出居中显示
2。就是我让它在哪个输出结果后换行就在哪换。 展开
1。首行输出居中显示
2。就是我让它在哪个输出结果后换行就在哪换。 展开
1个回答
展开全部
Private Sub Command1_Click()
Dim a, b, c, d, e, f, AA, BB, CC, DD, EE, FF
a = 560: b = 580: c = 540: d = 589: e = 580: f = 555
AA = 560: BB = 580: CC = 540: DD = 589: EE = 580: FF = 555
Open "c:\out.txt" For Output As #1
Print #1, Space(20) & String(8, "*") & "计算结果" & String(8, "*")
Print #1, ""
Print #1, Space(22) & String(8, "*") & "成绩" & String(8, "*")
Print #1, Space(10) & "a" & Space(4) & a & Space(8) & "b" & Space(4) & b & Space(8) & "c" & Space(4) & c
Print #1, Space(10) & "d" & Space(4) & d & Space(8) & "e" & Space(4) & e & Space(8) & "f" & Space(4) & f
Print #1, Space(22) & String(8, "*") & "成绩" & String(8, "*")
Print #1, Space(10) & "AA" & Space(3) & AA & Space(8) & "BB" & Space(3) & BB & Space(8) & "CC" & Space(3) & CC
Print #1, Space(10) & "DD" & Space(3) & DD & Space(8) & "EE" & Space(3) & EE & Space(8) & "FF" & Space(3) & FF
Close #1
End Sub
Dim a, b, c, d, e, f, AA, BB, CC, DD, EE, FF
a = 560: b = 580: c = 540: d = 589: e = 580: f = 555
AA = 560: BB = 580: CC = 540: DD = 589: EE = 580: FF = 555
Open "c:\out.txt" For Output As #1
Print #1, Space(20) & String(8, "*") & "计算结果" & String(8, "*")
Print #1, ""
Print #1, Space(22) & String(8, "*") & "成绩" & String(8, "*")
Print #1, Space(10) & "a" & Space(4) & a & Space(8) & "b" & Space(4) & b & Space(8) & "c" & Space(4) & c
Print #1, Space(10) & "d" & Space(4) & d & Space(8) & "e" & Space(4) & e & Space(8) & "f" & Space(4) & f
Print #1, Space(22) & String(8, "*") & "成绩" & String(8, "*")
Print #1, Space(10) & "AA" & Space(3) & AA & Space(8) & "BB" & Space(3) & BB & Space(8) & "CC" & Space(3) & CC
Print #1, Space(10) & "DD" & Space(3) & DD & Space(8) & "EE" & Space(3) & EE & Space(8) & "FF" & Space(3) & FF
Close #1
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询