Hello BariAbdul,
For example, if you wanted to place data around one Cube, you could use the TABDIM function. This function returns the dimension based off the cube and the order number of the dimension.
So...Cube1:Dim1:Dim2:Dim3....TABDIM('Cube1',1) = Dim1
To loop around the cube and return the dimension you could use:
Code: Select all
x = 1;
While(TABDIM('Cube1',x)@<>'')
vDim = TABDIM('Cube1',x);
x = x + 1;
End;
You will then have a loop which will give you a dimension inside the selected cube for every time the while loop continues. you could then loop around that dimension and pass every element of it into the CellPutS function. You could do this for each dimension in the said cube.
For example:
Code: Select all
x = 1;
While(TABDIM('Cube1',x)@<>'')
vDim = TABDIM('Cube1',x);
vDimSizCount = DIMIX(vDim);
y=1;
While(y < vDimSizCount);
vEl = DIMNM(vDim,y);
CellPutS('Cube1',vEl,Dim2,Dim3);
x = x + 1;
End;
You could do this for each dimension in the cube.
The main purpose of this type of TI script is to work with the data that is given to you by controlling the flow of the program. You can grab returned values based off your looping around cubes and dimensions, to pass the needed metadata into the CellPutS Function.
It is always a good idea to use the "CellIsUpdateable" function when using the CellPut functions. For example If(CellIsUpdateable('Cube1',vEl,Dim2,Dim3)=1); (CellPutS('Cube1',vEl,Dim2,Dim3); EndIf;
This helps you avoid the attempt to put write to cells that cannot be written to, such as rule derived cells and C level.
Hope this helps.