PB中二维数组的显示

carnationmxp 2010-11-18 09:49:04
定义了一个PB的二维数组array[21,21]
如何通过PB程序将数组中的所有元素全部显示出来呢。 并且是按规范的行和列! 高手赐教!
...全文
658 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaobn_cn 2010-11-19
  • 打赏
  • 举报
回复
需求写得有点模糊,按规范的行和列,是指行列对齐吗?

// mle_1是一个MultiLineEdit控件
for i = 1 to 21
for j = 1 to 21
// 使用fill进行间隔符填充
mle_1.text += fill(' ', 8 - length(array[i,j])) + array[i,j]
next
// 回车换行
mle_1.text += "~r~n"
next
carnationmxp 2010-11-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 glint 的回复:]
VB code

for i=1 to 21
for ii=1 to 21
text=text + space(1) + array[i,ii]
next
text =+ char(13)
next
[/Quote]

3Q3Q
carnationmxp 2010-11-19
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 xiaobn_cn 的回复:]
需求写得有点模糊,按规范的行和列,是指行列对齐吗?

VB code

// mle_1是一个MultiLineEdit控件
for i = 1 to 21
for j = 1 to 21
// 使用fill进行间隔符填充
mle_1.text += fill(' ', 8 - length(array[i,j])) + array[i,j]
next
……
[/Quote]

谢过喽!
PB菜鸟 2010-11-18
  • 打赏
  • 举报
回复
楼上的方法可以的
glint 2010-11-18
  • 打赏
  • 举报
回复

for i=1 to 21
for ii=1 to 21
text=text + space(1) + array[i,ii]
next
text =+ char(13)
next

1,077

社区成员

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

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