[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Need help editing script

Posted on 2016-10-22
3
Medium Priority
?
99 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
[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 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 33

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

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…
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/…
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)
Suggested Courses

650 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