一个比较弱的问题。
string linedata
int pos ,temppos
linedata="ab,cd,ef,gh,"
pos = pos(linedata, ",")
//我用这个只能取出第一个,的位置
我怎么才能得到第二个第三的位置
------解决方案--------------------
循环!
------解决方案--------------------
要使用循环加数组来实现.
大致为
long sz[]
long i = 0
string linedata
int pos ,temppos
linedata="ab,cd,ef,gh,"
do while pos(linedata, ",") > 0
i = i + 1
sz[i] = pos(linedata, ",")
linedata = mid(linedata,pos(linedata, ",") + 1 ,len(linedata))
最后循环获取数组中的值.
for i = 1 to UpperBoun(sz)
messagebox("",sz[i])
end for
------解决方案--------------------
- SQL code
string linedata int pos=0 ,temppos linedata="ab,cd,ef,gh," do while pos(linedata, ",",pos+1)>0 pos = pos(linedata, ",",pos+1) loop