for z= 1 or 2 or 3 it run ok
for z= 4 make error ( return the wrong numbers) why ?
- Code: Select all Expand view RUN
#include "fivewin.ch"
function test()
Local aline[3]
Local nposition[5]
Local nLine
Local nNumbers [5]
Local plinestring[4]
local z,k,n
local nCol
aline[1]:= {1,3,6,7,1}
aline[2]:= {3,1,6,1,9}
aline[3]:= {9,3,1,7,9}
plinestring[1]:="bbbbb"
plinestring[2]:="aaaaa"
plinestring[3]:="ccccc"
plinestring[4]:="abcba"
z:=4
nposition[1]:= substr(plinestring[z],1,1)
nposition[2]:= substr(plinestring[z],2,1)
nposition[3]:= substr(plinestring[z],3,1)
nposition[4]:= substr(plinestring[z],4,1)
nposition[5]:= substr(plinestring[z],5,1)
// xbrowser nposition
For k= 1 to 5 // numeri
For n= 1 to 5 //position
nCol:= k
If nposition[n]= "a"
nline:= 1
elseif nposition[n]= "b"
nline:= 2
elseif nposition[n]= "c"
nline:= 3
endif
nNumbers[k]:= aline[nline] [nCol]
next
nCol:= 0
nline:= 0
next
xbrowser nNumbers
return nil
if z= 1 return 3,1,6,1,9 ok
if z= 2 return 1,3,6,7,1 ok
if z= c return 9,3,1,7,9 ok
if z= 4 return 99999 bad why ? ( it must return me 11111)