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

Regarding the quantity field

Former Member
0 Likes
819

hi friends,

i am having a doubt like , i having the quantity field having the length of 13 ,

if the value of quantity is 300 - , i have to delete the - sign and capture the - sign in to one variable and display it in the next field

or else if the value of quantity is 300 , treat it as + and i have to capture the positive sign in to an variable.

regards

geetha.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
769

hi,

you can try this out..

clear v_next_field.

if quantity < 0.

quantity = quantity * (-1) " to remove the negative sign.

v_next_field = ' - '.

else.

if quantity > 0.

v_next_field = '+'.

endif.

Hope this helps.

Thanks,

sneha.

hi friends,

i am having a doubt like , i having the quantity field having the length of 13 ,

if the value of quantity is 300 - , i have to delete the - sign and capture the - sign in to one variable and display it in the next field

or else if the value of quantity is 300 , treat it as + and i have to capture the positive sign in to an variable.

regards

geetha.

5 REPLIES 5
Read only

Former Member
0 Likes
769

you can use the ABS function

if var lt 0.

var1 = abs( var ).

sig = '-' - this field can be used to capture the sign

endif.

here var is the quantity field, var1 could be any numeric field, and sig is a type c field of length 1.

Edited by: Priyank Jain on Aug 1, 2008 4:18 AM

Read only

Former Member
0 Likes
769

Hi,

Check if qty < 0, then multiply the qutitiy with '-1' and take '-' symbol to the next field other wise take '+'

ex.

IF qyt LT 0.

qty = -1 * qty.

MVOE '-' TO <field>.

ELSE.

MOVE '+' TO <field>

ENDIF.

Thanks,

Veera K

Read only

Former Member
0 Likes
769

saigeetha,

data:

newfield type c

if <your field> LT 0.

*<your field> = <your field> * -1.*

newfield = '-'.

else.

newfield = '+'.

Endif.

Read only

Former Member
0 Likes
770

hi,

you can try this out..

clear v_next_field.

if quantity < 0.

quantity = quantity * (-1) " to remove the negative sign.

v_next_field = ' - '.

else.

if quantity > 0.

v_next_field = '+'.

endif.

Hope this helps.

Thanks,

sneha.

Read only

Former Member
0 Likes
769

ok