>I use #define constant in SELECT statement and as character string like:
>
>
>CREATE CURSOR invoice ( price N(12,2), quantity N(2), packing N(2))
>#define d_quantity quantity*packing
>#define d_sum price*d_quantity
>
>SELECT d_sum FROM invoice
>
>TEXT TO ctxt noshow
> d_sum
> ENDTEXT
>MESSAGEBOX('Sum formula is: '+ctxt)
>
>
>This requires separate memory variable using TEXT command for each #define
>
>How to force MESSAGEBOX() to show d_sum value as character string without using TEXT command?
Is this what you want?
#define d_sum price*d_quantity
SELECT d_sum AS yourfield FROM source_table INTO CURSOR your_crs
SCAN
MESSAGEBOX('Sum formula is: '+TRANSFORM(yourfield,'9999999.99'))
ENDSCAN
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst