April 8, 2004 at 8:48 am
Help. Getting the following error
There is an error on line 0 of custom code: [BC30213] Comma or ')' expected.
Here is the custom code
Public Function CalcPercent(totals as double , fldValue as double ) as double
dim retVal as double
if totals = 0 then
retVal = 0
else
retVal = fldvalue / totals
end if
return retVal
End Function
Here is the call
=code.CalcPercent( Fields!lyTotals.Value , Fields!Video.Value - Fields!lyVideo.Value )
April 10, 2004 at 9:03 pm
I'm not an expert, but your code might work better like this:
ALTER Function CalcPercent(@totals as double , @fldValue as double )
RETURNS double AS
Begin
dim @retVal as double
if @totals = 0 then
@retVal = 0
else
@retVal = @fldvalue / @totals
end --if
return @retVal
End --Function
Hope this helps.
Butch
April 11, 2004 at 6:49 pm
ur code looks fine
try adding ( )
=code.CalcPercent(Fields!lyTotals.Value , (Fields!Video.Value - Fields!lyVideo.Value))
do let us know if this works or u hv found out the solution
thanks
April 12, 2004 at 7:04 am
The following worked. The only difference that I see is that I removed the blank line before the body of the function.??
Thanks for the assistance.
Public Function CalcPercent(totals as double, fldValue as double) as double
dim retVal as double
if totals = 0 then
retVal = 0
else
retVal = fldvalue / totals
end if
return retVal
End Function
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy