[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Need help editing script

Posted on 2016-10-22
3
Medium Priority
?
102 Views
Last Modified: 2016-10-22
I have this script:

if not rs.EOF then
      response.write " " & rs("pName")
      if SESSION("clientID")<>"" then response.write " (" & rs("pInStock") & ")"
end if

I need to modify it to show "In stock." if the value for & rs("pInStock") & is >0 and "Out of stock." if the value is <1.

I have am having a bit of trouble with this. Anyone want to try? Any help greatly appreciated.

Best regards,
Evert
0
Comment
Question by:Evert Jor
3 Comments
 
LVL 71

Expert Comment

by:Qlemo
ID: 41855278
if not rs.EOF then
      response.write " " & rs("pName") 
      if SESSION("clientID")<>"" then
        stock =  rs("pInStock")
        response.write " (" & stock & ") "
        if stock < 1 then
          respone.write "Out of stock"
        else
          response.write "In stock"
        end if
    end if
end if

Open in new window

0
 
LVL 34

Accepted Solution

by:
Big Monty earned 2000 total points
ID: 41855282
if not rs.EOF then
      response.write " " & rs("pName")
      InStock = "in Stock"
      If CInt( rs("pInStock")) < 1  then InStock = "out of stock"
      if SESSION("clientID")<>"" then response.write " (" & InStock & ")"
end if
0
 

Author Closing Comment

by:Evert Jor
ID: 41855349
This solution worked. The other one worked only partially.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month19 days, 3 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question