注册 登录
编程论坛 ASP技术论坛

有几句的程序帮忙小弟解释下

frdal 发布于 2005-07-27 10:49, 1001 次点击
1    <%
2    set myfileobject=server.createobject("scripting.filesystemobject")
3    set mytextfile=myfileobject.opentextfile("c:/myweb/test.txt")
4    while not mytextfile.atendofstream
5    response.write(mytextfile.readline)
6    wend
7    mytextfile.close
8    %>

第4行的句子是什么意思?
while....wend.....是怎么用?
10 回复
#2
newpc2005-07-27 11:47
只到   __   wend 才结束
#3
无根泉2005-07-27 11:56
以下是引用frdal在2005-7-27 10:49:33的发言: 1 <% 2 set myfileobject=server.createobject("scripting.filesystemobject")'创建一个fso对像 3 set mytextfile=myfileobject.opentextfile("c:/myweb/test.txt")'打开一个文本文件 4 while not mytextfile.atendofstream'判断指针是否位于文件的尾部! 5 response.write(mytextfile.readline)'输入这个文件中的内容 6 wend 7 mytextfile.close'关闭文件 8 %> 第4行的句子是什么意思? while....wend.....是怎么用?

[此贴子已经被作者于2005-7-27 11:58:39编辑过]

#4
frdal2005-07-27 15:17
大侠,再问下,要是那个指针在尾部,是不是不进行写操作?
#5
cokexj2005-07-27 15:54
第4行是作循环判断用
#6
无根泉2005-07-27 16:11
以下是引用frdal在2005-7-27 15:17:56的发言: 大侠,再问下,要是那个指针在尾部,是不是不进行写操作?
指针到尾部说明文件结束了, 也就是说 如果文件没有结束,则循环输入文件内容, 否则,退出循环
#7
frdal2005-07-27 20:26
谢谢了,再问下
mytextfile.readline中的 readline是不是一行一行读的意思?
然后再用指针来判断是不是到最后一行了?
#8
无根泉2005-07-28 09:21
是的,
#9
frdal2005-07-28 09:22
知道的,帮忙告诉我下~~~~~~~谢
#10
frdal2005-07-28 09:22
好的,你怎么突然来了
#11
mayan08282010-05-22 16:07
应该是while....end
是循环判断语句,当是什么条件时结束
1