如何在lotus script里面读一个文本文件的第一行?

melia 2005-03-31 12:57:36
我放在domino的文件夹下的一个文本文件里第一行的数据我要在代理中取得,代码只写了一点,后面找不到lotus script里面能用的方法了,就没贴出来,谁用lotus读过文本文件数据的请帮个忙,看看怎么写。
Sub Initialize
Dim session As New notessession
Dim curdb As notesdatabase
Dim doc As notesdocument
Dim curdoc As notesdocument

'Set curdoc=s.documentcontext
'Set curdb=s.currentdatabase

Msgbox "-----------------------getprogrampath start ------------------------------"
On Error Goto esub
Dim pathName As String
Dim pathstr As pathclass
syspath=session.getenvironmentString("Directory",True)
Chdir(syspath)
fileName$="getpmpath.txt"
fileNum% = Freefile()

Open fileName$ For Random Access Read As fileNum%
Msgbox fileName$
'Seek fileNum%, 1
'Get #fileNum%,,pathstr
。。。。。。省略
Close fileNum%
Msgbox path.name
Exit Sub
esub:
Msgbox "-----------------------del error ------------------------------"
Exit Sub
End Sub
...全文
121 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhuyimao 2005-04-01
  • 打赏
  • 举报
回复
找到换行符。就是第一行楼
danfeihao 2005-03-31
  • 打赏
  • 举报
回复
' Display the contents of c:\config.sys a line at a time.
Dim text As String, fileNum As Integer
fileNum% = FreeFile()
Open "c:\config.sys" For Input As fileNum%
Do While Not EOF(fileNum%)
Line Input #fileNum%, text$
Print text$ ' Prints one line of config.sys
Loop
Close fileNum%


这句话“Open fileName$ For Random Access Read As fileNum%”不是很合适吧!
melia 2005-03-31
  • 打赏
  • 举报
回复
up一下

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧