Print d.no, d.name, d.mark(1), d.mark(2), d.mark(3)
Close #1
End sub
(1)d as stud
(2)get #1,5,s
(3)s.mark(2)=s.mark(2)+5
(4)get #1,5,d
Private Sub Command1_Click()
Dim no%, gz!, zc$
Open ―c:\my\zg.txt‖ for input as #1
Open ―c:\my\Lszg.txt‖ for output as #2
Do while not eof(1)
Select case zc
Gz=gz*1.15
Case ―讲师‖
Case ―助教‖
Gz=gz*1.05
End select
Loop
Close #1, #2
Open ―c:\my\zg.txt‖
Open ―c:\my\Lszg.txt‖Do while not eof(2)
Input #2, no, gz, zc
Loop
Close #1, #2
End sub
(1)input #1,no,gz,zc
(2)case ―教授‖,‖副教授‖
(3)gz=gz*1.10
(4)write #2,no,gz,zc
(5)for output as #1
(6)for input as #2
(7)write #1,no,gz,zc
7. 统计文本文件中各个字母出现的个数(大小写不区分),存放在S字符串数组中,统计结果在窗体上显示出现过的字母和出现的次数。要求:
(1)统计的文件名通过文件列表框获得,文件列表框的名称为File1,文件列表框仅显示扩展名为.txt文件。
(2)当双击文件列表框的某选中的文件时,将文件内容全部读入文本框,然后对其进行统计。 Private sun Drive1_change()
Dir1.path=Drive1.Drive
End sub
Private sub Dir1_change()
File1.Path=Dir1.Path
End sub
Private sub File1_DblClick()
Dim s%(1 to 26), i%, c$, j%, fname$
For i=1 to 26
next i
if right(file1.path, 1)=‖\‖ then
fname=file1.path+file1.filename
else
end if
label1=‖选中的文件名‖+fname
Open fname for input as #1
For j=1 to len(text1.text)
If c>=‖A‖ and c<=‖Z‖ then
s(i)=s(i)+1
end if
next j
print ―出现的字母及个数‖
for i=1 to 26
if
next i
End sub
(1)=0
(2)file1.path+‖\‖+file1.filename
(3)input(lof(1),1)
(4)ucase(mid(text1,i,1))
(5)asc?-asc(―A‖)+1
(6)s(i)>0 then print chr(i+64);‖:‖;s(i);
四、简答题
1. 什么是文件?什么是记录?
2. 根据访问模式,文件分为那几种类型?
3. 文件列表框的FileName属性中是否包含路径?
4. 构造满足下列条件的Open语句:
(1)建立一个新的顺序文件Seqnew.dat,供用户写入数据,指定文件号为1。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-22730-35.html
说得对
你就不能说让国产手机淘汰美国苹果吗