Skip to Content
author's profile photo Former Member
Former Member

trouble in summing with char...

Dear friends,

I report programing i want to add totals in left hand side

and at bottom.but the quantity to which i hve to add having character like ND there.

system is showing short dump error we cant add numbers with char.can u give some solutions.

regards

veera

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2006 at 02:22 PM

    Hi Veera,

    you can do the arithmetic calculations only for numeric fields...

    Regards,

    Vidya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2006 at 02:24 PM

    hi Veera,

    declare the field that you are declaring it as char as type N or I....

    <b>in that case do this way .. do all the arithematic caluclations that you wnat to do and put them in to I or N variable and then move them in to type C and print ..</b>

    Regards,

    Santosh

    Message was edited by: Santosh Kumar P

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2006 at 02:27 PM

    Hi Veera,

    what are the values you have in that field...

    use a temporary variable of type i in between and do the additions..

    again output it as char...

    Regards,

    Vidya.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 29, 2006 at 02:33 PM

    As to my understanding of your issue...can you please let us know if all the rows have some characters or the field always starts with some character and digits at the end(which you wish to sum) or there can some rows with char and some with digits and you need to sum only the digit ones ??

    Regards

    Anurag

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.