igorrino
4th May 2007, 16:02
how to get an array using apis? I have tried this way but it does not work, is of type string but nothing
lineaserror,lineaserror2,lineasorden and lineassolic are string with 300 caracters and 300 positions
extern domain tcstr.300 lineaserror(300)
for i = 1 to 300
stpapi.get.field("tdpur2201m000", "lineaserror" , linea,i) |*listado error
lineaserror(1,i)=linea
stpapi.get.field("tdpur2201m000", "lineaserror2", linea2,i) |*listado error
lineaserror2(1,i)=linea2
stpapi.get.field("tdpur2201m000", "lineasorden", linea3,i) |*listado error
lineasorden(1,i)=linea3
stpapi.get.field("tdpur2201m000", "lineassolic", linea4,i) |*listado error
lineassolic(1,i)=linea4
endfor
it recovers a line but the whole moment the same one already is (it) i=1 or 2...
mark_h
4th May 2007, 16:22
Is this a multi-occurance session or what? I am not familiar with this session and we do not have it. I am wondering if each line is another record rather than an array element. In that case I would expect in you look a stpapi.browse.set with the next.set option. Of course I can be wrong since it looks like you are on Baan 5.
igorrino
4th May 2007, 16:28
Is this a multi-occurance session or what? I am not familiar with this session and we do not have it. I am wondering if each line is another record rather than an array element. In that case I would expect in you look a stpapi.browse.set with the next.set option. Of course I can be wrong since it looks like you are on Baan 5.
This is sesion in which I gather the values of the orininal, the original sesion is well, I have the problem in this sesion,where I gather the arrays
i have an array like this in original session:
lineaserror(1,1)="error 1"
lineaserror(1,2)="error 2"
.
.
lineaserror(1,30)="error 30"
i want to get this array using in other session
for i=1 to 30
stpapi.get.field("tdpur2201m000", "lineaserror" , error,i)
lineaserrortemp(1,i)=error
endfor
but only the first position of the array is loaded in error variable,
mark_h
4th May 2007, 17:07
Okay - I think I understand. Can you put tdpur2201m000 in debug mode and see what happens when the stpapi.get.field is executed? These fields are form fields - right?
igorrino
7th May 2007, 10:19
hello:
we have put in debbug both sessions.
In the original sesion tdpur2201m000 the array is correctly loaded,but in the sesion in which we do stpapi.get.field("tdpur2201m000", "lineaserror" , error,i) only the first position of the array is loaded in error variable.
is this an error of stpapi.get.field instruction?
mark_h
7th May 2007, 13:40
hello:
is this an error of stpapi.get.field instruction?
It could very well be. You missed a question - Are these form fields or internal variables? If they are form fields I would report this to Baan. If they are internal variables this will not work.
igorrino,
Please post the complete code here so others can suggest changes.
What is the array dimension of the variable error? by default, if you just using a statement like: string error it is 1 dimensional variable similar to string error(1)