on 06-09-2010 1:48 PM
Dear experts,
the following funktion has 3 inputs an one output. It shall forward input 3 if input 2 is found in input 1.
public void take3IfFound2In1(String[] a, String[] b, String[] c, ResultList result, Container container) throws StreamTransformationException{
for ( int i = 0; i < a.length; i++ )
{
if(a<i>.equals(b[0])) {
result.addValue(c<i>);
}
else {
result.addSuppress();
}
}
}
So far it is working, but I am not able to put a CopyValue behind. Why not? I need the output undefined times. Please help.
Copy Value works based on the index value of the input field. It can not dynamically repeat the values with changing index. You have to enhance the UDF itself by adding anothe input fields which determines how you want to repeat the input values.
VJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
The boolean function ifWithoutElse function would almost do the same thing as the UDF you've written since you are comparing the contents of array a to a constant b[0] and then outputting the contents of c[]. Since it is not possible to use copyValue for suppressed values, you can try this approach:
1. Use spaces first
2. Do your copy value
3. Suppress the spaces using another UDF
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vijaya,
thanks for your response. Unfortunately, I can't check this anymore but I am sure I will need it again. Please tell me how you would implement your idea?
To add one more input is not that difficult but what shall happen inside the function? Sorry about my stupid questions - I am quite unfamiliar with this stuff.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.