Question integer counter

dragoon

New member
Joined
Oct 6, 2008
Messages
2
Programming Experience
Beginner
hey guys !


i want to make my integer to count only if the number over $30 and only once per customer

i tried

if discount >30 then
discountinteger += 1
end if

but that didn't work it added more than 1

any ideas ¿?¿?
PLZ help !! :)



thanx !
 
Last edited:
Based on that snippet discountinteger will increment byone everytime the discount > 30 condition is met. You could add an additional condition to the If statement..

VB.NET:
if discount >30 AndAlso discountinteger <  'SomeNumber' then
discountinteger += 1
end if
 
thanx for that !!!

but now it only adding 1 to the integer and if i put the number 2 {AndAlso discountinteger < 2 then

it adding 2 to the integer.


i want it to add 1 for each customer each time the discount > $30
 
private sub something()
dim discountinteger as integer = 0

for each customer in ???
if discount > 30 and [code to ensure counting for only once per customer] then
discountinteger = discountinteger + 1
end if
next

end sub

note: alternatively, if you have a datasource for your customers, you can also select distinct them before checking their discounts.
 
Back
Top