Solved

Need help editing script

Posted on 2016-10-22
3
53 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
3 Comments
 
LVL 68

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 32

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now