2008 Aug 01 9:13 AM
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.
2008 Aug 01 9:28 AM
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,
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.
2008 Aug 01 9:18 AM
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
2008 Aug 01 9:21 AM
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
2008 Aug 01 9:25 AM
saigeetha,
data:
newfield type c
if <your field> LT 0.
*<your field> = <your field> * -1.*
newfield = '-'.
else.
newfield = '+'.
Endif.
2008 Aug 01 9:28 AM
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.
2008 Oct 14 10:58 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |