单选题
设在当前目录下有一个名为“file.txt”的文本文件,其中有若干行文本。编写如下程序:
Private Sub Command1_Click()
Dim ch$,ascii As Integer
Open"file.txt"For Input As #1
While Not EOF(1)
Line Input #1.ch
ascii=toascii(ch)
Print ascii
Wend
Close #1
End Sub
Private Function toascii(mystr As String)As Integer
n=0
For k=1 To Len(mystr)
n=n+Asc(Mid(mystr,k,1))
Next k
toascii=n
End Function
程序的功能是______。