Hi, can somebody help me with this code, i tried to run it with F11 to see the flow but i just cant understand how does it changed.,
q:
why after doing (byval a as decimal, byval b as decimal) as decimal?
we type as decimal after we have declare that a and b as deciaml
why everytime i input 1 firts ,2, , 2= 6
whats the possible reason thanks....
Code:
Sub main
try
dim cls as new mysample class
dim var1,var2,var3,result as decimal
dim counter as integer
var1=convert.todecimal(inputbox("enter a number(0,1 or 2)"))
for counter=0 to 1
myarray(counter)=convert.todecimal(inputbox("Enter another number"))
next
var2=mayarray(0)
cls.s=myarray(1)
result=cls.compute(var1,var2)
msgbox(result)
catch ex as exceptiopn
msgbox(ex.msg)
end try
end sub
PUblic class mysampleclass
private x as integer
property s() as decimal
get
return x
end get
set(byval value as decimal)
x=value
end set
end property
function compute(byval a as decimal, byval b as decimal) as decimal
select case a
case0
return(s+b)
case1
return (s+b+b)
case2
return(s+s+b)
end select
end function
end class
q:
why after doing (byval a as decimal, byval b as decimal) as decimal?
we type as decimal after we have declare that a and b as deciaml
why everytime i input 1 firts ,2, , 2= 6
whats the possible reason thanks....
Comment