Results 1 to 2 of 2

Thread: variable types

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Posts
    1

    Question variable types

    I am trying to write a vb component, which receives values from an asp page and then makes some calculations before returning the value. However, as I am fairly new to this game, it is coming up with an error saying 'overflow'!

    The values I pass into the component are integers. These are then multiplied with some constant values, which can be anything up to 50000. I therefore stored these in a variable of type long. This value is then multiplied by 0.10, to give a percentage. The function then returns the value back to the asp page as a variable type double.

    I hope this makes sense, and would appreciate it very much if anyone could suggest where I am going wrong.

  2. #2
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80
    The number after multiplication is too large to be stored in a long variable, I would suggest perhaps dividing by .10 before multiplying, the calculation will produce the same result but the number should not 'overflow' the variable if you do it this way.

    Hope this is of help.

    Best regards,

    Rob Brown.

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