ltannous
21st April 2004, 17:04
I have a session that has a field with an array.
The field is tdssc002.iedi. This has a depth of 5.
How can I get my program script to select the tdssc002.iedi(5) using the following

zoom.from.all:
on.entry:

import("tdssc002.iedi", hold.reln)
reln.f = hold.reln


The above will retreive the data from the first field.
When I change this to tdssc002.iedi(5), there is no data present.

NPRao
21st April 2004, 20:23
I think you have to use - get.indexed.var() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_variables_interprocess_transfer_get_indexed_var)

BaanERP Programmers Guide
get.indexed.var()
--------------------------------------------------------------------------------
Syntax
long get.indexed.var( long processno, "variable", ref variable, long dim1
[, long dim2, long dim3, long dim4 ] )

Description
This retrieves the value of the specified variable. It is the same as get.var()
except that it enables retrieval of individual array elements.

Arguments
processno
The process from which the variable is to be retrieved. You can specify the
process ID, or you can use the predefined variables pid or parent.

“variable”
The name of the variable to be retrieved (this must be a lower case string).
The variable can be a single variable or an array and must be declared as
external. Instead of specifying the variable name, you can specify a variable
in which the name is stored.

variable
This stores the value of the retrieved variable or array element.

dim1 to dim4
Use these to specify a particular array element to be retrieved. To retrieve a
single variable, set dim1 to 1 and omit the other dim arguments.

Return values
0 success
1 general error
2 incorrect number of dimensions
3 variable not found
4 array element not available

Context
Bshell function.

Example
extern long ltbl(10,5)
extern string block(10,5,5)

string ret_str(10)
long ret_lng
long e

ltbl(1,1) = 1
ltbl(2,2) = 2
ltbl(3,3) = 3

block(1,1,1) = "The"
block(1,1,2) = "quick"
block(1,2,1) = "brown"
block(1,2,2) = "jumps"

e = get.indexed.var( pid, "block", ret_str, 1, 2 )
| ret_str contains "quick "
e = get.indexed.var( pid, "ltbl", ret_lng, 3, 3 )
| ret_lng is equal to 3

just_fro
21st April 2004, 22:37
[whispermode on]
did you define 'hold.reln' as an array?
[whispermode off]