Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

data type Help

Former Member
0 Likes
433

I have values a1,a2,a3...a12 and b1,b2,b3...b12. All of them are char type.

The values in them can be non-zero,zero or space and negative values are also possible.

My requirement is add a1,a2 and a3 in to a variable W1, add b1 , b2 and b3 to a variable W2. Follow the same to other values.

I need to compare W1 to W2 , If W1 > W2 I need to print W1 in the report.

My query is as follows.

1. How do sum up these values and compare these char based values using > expression.

2. If move them to Integer and If the value is space it treats them as 0 and prints zero.

Any thoughts on this, will be appreciated.

Regards,

Har.

2 REPLIES 2
Read only

Former Member
0 Likes
409

Hi Harpit,

You can move these values to Integer and perform your operation.

While displaying the value of W1 which should be displayed if W1 > W2. Also add a check that W1 is not equal to zero. If you add this condition also to the existing IF statement, evenif W1 is equal to 0, it will not print 0.

Let me know if this is okay.

Read only

Former Member
0 Likes
409

What do you have to do if the value is space? Why can't you move and do your addition only if the value is a number? What are the lengths of the fields? Are the values left-justified or right-justified?