几何尺寸与公差论坛

 找回密码
 注册
查看: 767|回复: 0

【转帖】if text not nil then

[复制链接]
发表于 2009-4-12 18:41:59 | 显示全部楼层 |阅读模式
if text not nil then...
i know nothing.
what i want to know is: if i have a piece of text that's blank (or is only a space), i want another piece of text to read the same unless the 1st, 2nd, 3rd etc. has a value in which case, i want the last case to be the value used:
eg.
txt1
txt2
(space)
(space)
output:
txt2
or...
txt1
txt2
(space)
txt3
output:
txt3
i know this is simple code that will end up in "custom properties" in a border (yes, i know it's redundant info).
any help is appreciated.
if i had a penny for every bug i've found... day...umm that's a buncha' copper...
dim arr() as string
const txt as string = "txt1,txt2, ,,txt3"
dim i as integer
arr = split(txt, ",")
for i = ubound(arr) to 0 step -1
if trim(arr(i)) <> "" then
exit for
end if
next i
msgbox arr(i)
quick
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2025-1-3 10:26 , Processed in 0.036016 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表