|
-
Jun 14th, 2000, 12:57 AM
#1
Thread Starter
Junior Member
Hi,
I want to add two byte variables together and if the resulting value is greater than 255, then i want the sum to be set at 255. So far, i have had no luck at all. i tried setting up a temporary int variable like this:
dim x,y,sum as byte
dim temp as integer
temp = x+y
if temp >255 then
sum = 255
else
sum = temp
end if
but i still get an overflow error. How do i fix this???
Shaheeb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|