David wrote:
Hi,
I have the following calculation I am trying to work out ..... Not
sure how ?
Variable 1 = minstock
Variable 2 = oDict(oKey)
I need to test if my variable 'minstock' <= 40% of oDict(oKey)
I've tried
IF minstock <= oDict(oKey)*0.4 then
swarn = "Low Stock"
else
swarn = " "
end if
I just get an error
What error?
>
What is the correct way of writing this calculation ?
It looks correct to me.
Give us some actual data to look at, i.e., provide us with a repro
script that we can run to reproduce your symptoms. We don't want to see
your entire page -- we don't even need to see your actual data. Just
provide a small repro script that uses data that reproduces the
symptoms. Something like this:
<%
dim oKey, oDict, minstock
minstock=20
set oDict=createobject("scripting.dictionary")
oKey="test"
oDict.Add oKey, 100
IF minstock <= oDict(oKey)*0.4 then
Response.Write "Low Stock"
Else
Response.Write "Stock OK"
End If
%>
This works fine for me, by the way.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.