Page 1 of 1

Turbo Integtrator checking

Posted: Fri May 20, 2011 8:48 am
by luiswiseman
Hi all,

I have a variable name code which is in string type but the value is mixing. for example I have a solid number value which is 001, 002, 003... and that's all the value I want to. Unfortunately, there are also char value like 'abc', 'asd'..etc. So can u help me on how to get rid of all the unwanted value.

thanks

Re: Turbo Integrator checking

Posted: Fri May 20, 2011 9:30 am
by David Usherwood

Re: Turbo Integtrator checking

Posted: Tue May 31, 2011 4:38 am
by luiswiseman
hey I have another problem I appreciate whoever could help. I have a variable to store let say 100 of data, so I want to put the data into the cube using cellputn, however, i also want to insert the data from that variable to another cell. which mean I want to insert data using same variable into the difference cell by certain condition..

thanks

Re: Turbo Integtrator checking

Posted: Tue May 31, 2011 4:47 am
by Alan Kirk
luiswiseman wrote:hey I have another problem I appreciate whoever could help. I have a variable to store let say 100 of data, so I want to put the data into the cube using cellputn, however, i also want to insert the data from that variable to another cell. which mean I want to insert data using same variable into the difference cell by certain condition..
Use the If function to determine whether the condition is True or not.

If it is, use a second CellPutN inside the If/EndIf block to write the data to the second location. All you have to do is use different element arguments in the second function.

Re: Turbo Integtrator checking

Posted: Tue May 31, 2011 8:40 am
by luiswiseman
thanks for reply,

these are some of my variable value, (ElementA, 101,102,103,104,105, ElementB, 111, 122,123,124,126, ElementC, ....). What I'm going to do is I want to put the value from 101 till 105 into a particular cell and 111 till 126 into another cell. Logically, I can use the value 'ElementA' and 'ElementB' to separate them but how can I interpret them to if else statement.

Re: Turbo Integtrator checking

Posted: Tue May 31, 2011 7:48 pm
by Alan Kirk
luiswiseman wrote:thanks for reply,

these are some of my variable value, (ElementA, 101,102,103,104,105, ElementB, 111, 122,123,124,126, ElementC, ....). What I'm going to do is I want to put the value from 101 till 105 into a particular cell and 111 till 126 into another cell. Logically, I can use the value 'ElementA' and 'ElementB' to separate them but how can I interpret them to if else statement.
I'm not sure that I follow you. Do you have these variables on a single record, so that each row contains ElementA, 101, 102, 103 (etc)? (Obviously 101, 102 etc must refer to the variable value, not the name, which might be something like V1, V2, V3 etc.)

If so you'd just add the variables together when doing the cellputn and use multiple statements.
CellPutN(V2+V3+V4+V5+V6, Elements that relate to ElementA);
CellPutN(V8+V9+V10+V11+V12, Elements that relate to ElementB);

and so on.

If these values are coming through in different rows, so that each row has (say)
ElementA, 101
ElementA,102
ElementA, 103
...
ElementB, 111

and so on,

you could use an If statement to work out the variables that the CellPutN is writing to but you'd also need to aggregate the values by doing a CellGetN to get the current value, then writing the sum of that back to the cell. For instance:

dbl_CurrentVal = CellGetN(The elements that correspond to ElementA, B or whatever relates to that row);
CellPutN (dbl_CurrentVal+V2, The elements that correspond to ElementA, B or whatever relates to that row);

In this way you'd ultimately add up the 101, 102 etc values.