Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2004, 12:42 AM
Registered User
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Newbe - A general question about returns.

I am reading the book Beginning Active Server Pages 3.0 - THIS IS A GREAT BOOK!

On page 133 there is an example that I typed in that helped me understand how to use the VBScript function TypeName to return a variant subtype. The example is a follows:

<%
    Dim dblPi, varWhatIsPi, datToday, whatIsDate, strText, whatIsText
    dblPi = 3.142
    varWhatIsPi = Typename(dblPi)

    datToday = Date
    whatIsDate = TypeName(datToday)

    strText = "Hello World"
    whatIsText = TypeName(strText)

    Dim emp
    emptyVar = TypeName(emp)
%>
<p><B> dblPi returns <%= varWhatisPi %></p>
<p>datToday returns <%= whatIsDate %></p>
<p>strText returns <%= whatIsText %></p>
<p>emp returns <%= emptyVar %></B></p>

I understand what the program is doing. My question is why is there an equal sign in front of the variable when the variant subtype is returned? What is its function?

Example: emp returns <%= emptyVar %>

Thanks!
 
Old March 10th, 2004, 01:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

The equals sign (=) is shorthand for response.write().
So the line : emp returns <%= emptyVar %>
Means the same as: emp returns <% response.write(emptyVar) %>


======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old March 10th, 2004, 01:31 AM
Registered User
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you rodmcleay!!!!!!
 
Old March 10th, 2004, 01:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

No Worries.

======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
General Question about the beerhouse example kss BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 26th, 2008 12:08 PM
General Question About c++ madeebmir C++ Programming 0 August 15th, 2006 10:48 AM
Very general question merianos VB How-To 4 August 1st, 2006 12:24 PM
General Question stu9820 ASP.NET 1.0 and 1.1 Basics 2 September 23rd, 2003 03:36 PM
General Question about Dispose DKS BOOK: ASP.NET Website Programming Problem-Design-Solution 1 July 22nd, 2003 06:44 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.