[VBA]数据结构怎样输出?
怎样把vba中的数据结构,在运行之后以文本(.txt)的形式输出?请教一下应该怎样编程。 做个函数呀
Private Type TA<BR> a As Double<BR> b As Integer<BR>End Type<BR>Function OutPutTA(a As TA)<BR>OutPutTA = a.a + "," + a.b<BR>End Function<BR> output是一个输出函数吗?
我得要求是运行后得到一个.txt文件,里面是TA的数据。 Private Type TA<BR> a As Double<BR> b As Integer<BR>End Type<BR>Function OutPutTA(a As TA)<BR>OutPutTA = a.a & "," & a.b<BR>End Function<BR>Sub TT()<BR>Dim fso As Object<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Dim ts As Object<BR>Set ts = fso.OpenTextFile("c:\1.txt", ForAppending, True)<BR>Dim a As TA<BR>a.a = 1
ts.WriteLine OutPutTA(a)<BR>End Sub Private Type TA<BR> a As Double<BR> b As Integer<BR>End Type<BR>function OutPutTA(a As TA)<BR>OutPutTA = a.a & "," & a.b<BR>End Function<BR>Sub TT()<BR>Dim fso As Object<BR>Set fso = CreateObject("Scripting.FileSystemObject")<BR>Dim ts As Object<BR>Set ts = fso.OpenTextFile("c:\1.txt", ForAppending, True)
~~~~~~~~~~~~~~~~~~无效的过程或函数调用<BR>Dim a As TA<BR>a.a = 1
ts.WriteLine OutPutTA(a)<BR>End Sub
页:
[1]