Results 1 to 2 of 2

Thread: Data type convert issue

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    135

    Data type convert issue

    Hi,

    In order to re-sort the data received in USB easier, I send the data array received in USB (declared as Byte) to a temporary array (declared as SByte) to re-sort. I declared the temporary array as SByte just for easy sorting. After I compiled, an error message came up "make sure not divided by zero". I tried to use convert.SByte but still didn't help. Is it not allowed to send data to an array with different data type declaration? any suggestions?

    I appreciate it!

  2. #2
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    Re: Data type convert issue

    Why don't you consider the error message. "Make sure not to divide by zero." Is there any division in your code. If there is and you divide by zero then you'll get that message. If you haven't stored anything in some array element then it will be zero so if you divide something by that you'll get that message. You could try filling the array up with something like 1 just as an experiment to see if that eliminates your problem but if there's not too much code to search through then you can probably go right to the problem area.
    Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.

    "Persistence is the magic of success." Paramahansa Yogananda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width