简单的问题,今天结贴。

linmf66 2004-04-01 01:15:14
我写了一段代码,从0-2000中赛选出了200个数,请问怎么把这数据输出到一个编辑框中(或者把这些数输出到.txt文件中)?不要告诉我用数据库用数据窗口。谢谢
...全文
87 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
linmf66 2004-04-01
  • 打赏
  • 举报
回复
呵呵,谢谢各位~
lzheng2001 2004-04-01
  • 打赏
  • 举报
回复

mle_1.text = mle_1.text + '~r~n' + string(No1)
linmf66 2004-04-01
  • 打赏
  • 举报
回复
谢谢!

我回去看看
klbt 2004-04-01
  • 打赏
  • 举报
回复
不用单行编辑器,用多行编辑器。
xiekf 2004-04-01
  • 打赏
  • 举报
回复
integer i,j,k,queue[200],number
boolean repeat
k=fileopen('c:\tmp.txt',linemode!,write!,shared!,replace!)
mle_1.text=''
i=1
do while i<=200
number=rand(2000)
for j=1 to i
if queue[j]=number then
repeat=true
exit
else
repeat=false
end if
next
if repeat=true then //get the number again
else
queue[i]=number
mle_1.text+=string(number)+',~r~n'
filewrite(k,string(number))
i=i +1
end if
loop
fileclose(k)
bluerain1980 2004-04-01
  • 打赏
  • 举报
回复
sting ls_str
for i = 1 to 200
ls_str + ls_str + string(number)//number你选择的数

next
sle_1.text = ls_str
//往文件里写大约为
ls_tdocname = "c:/temp/a.txt"
ll_tfilenum = FileOpen(ls_tdocname, StreamMode!, Write!, LockWrite!, Replace!)
FileWrite(ll_tfilenum, ls_str)
fileclose(ll_tfilenum)

linmf66 2004-04-01
  • 打赏
  • 举报
回复
这样循环的话,不也是每次只能看到一个数?

我希望能把这200个数全都显示出来,好复制到word里打印。
szpqq 2004-04-01
  • 打赏
  • 举报
回复
哥们,你不能循环加吗?
String ls_total=""
每次取出一个数
ls_total+=Ls_01

......


sle_1.text = ls_total

qianfl 2004-04-01
  • 打赏
  • 举报
回复
一个编辑框放得下二百个数字么?
linmf66 2004-04-01
  • 打赏
  • 举报
回复
sle_1.text = Ls_01
的话,不是就只能看到最后的一个数据了?

to sincerity(sincerity) 能否详细点?我刚学用pb
workhand 2004-04-01
  • 打赏
  • 举报
回复
LS_01 = String(Ll_02)
sle_1.text = Ls_01
sincerity 2004-04-01
  • 打赏
  • 举报
回复
就是一个字符串,往编辑框里加不就行了。

输出文件:组成一个字符串,转成 Blob,然后再 FileWrite 到 txt 里去

1,108

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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