Solved

Need help editing script

Posted on 2016-10-22
3
87 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:EvertJor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 70

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 33

Accepted Solution

by:
Big Monty earned 500 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:EvertJor
ID: 41855349
This solution worked. The other one worked only partially.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

732 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