p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 27th, 2005, 03:43 PM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default variable as operator...

Hello.

I've been racking my brains for a few days trying different methods of reaching my goal... "using a variable to store an operator".

The sample below shows using an operator/variable and actually using the operator... the operator/variable does not work?

Here is a very simple version of what I want to achieve:
--------------------------------------------------------
vStartWeekOnWhatDayOriginal = "03/22/2005"
vFollowUp = "02/22/2005"

vTest = "<="

response.write "Variable operator : "&vTest&"<br>"
response.write "<BR>This is the value of follow up:"&vFollowUp
response.write "<BR>This is the value of start week on what day:"&cstr(cdate(vStartWeekOnWhatDayOriginal))
'response.write "<BR>This is the result using VARIABLE operator: "& eval(vFollowUp &cstr(vTest)& cstr(cdate(vStartWeekOnWhatDayOriginal)))&"<BR>"

if vFollowUp & vTest & cdate(vStartWeekOnWhatDayOriginal) then
response.write "Inside if This is the result using actulal operator: "&eval(vFollowUp >= cstr(cdate(vStartWeekOnWhatDayOriginal)))&"<BR>"
end if

if vFollowUp <= cstr(cdate(vStartWeekOnWhatDayOriginal)) then
response.write "<BR>Inside if___This is the result using actulal operator: "&eval(vFollowUp >= cstr(cdate(vStartWeekOnWhatDayOriginal)))&"<BR>"
end if
--------------------------------------------------------

As you can see, I've tried using the "eval()" function as well, I've tried using a case select statements... it seems to be a little something I can't figure out right now.

In the end I'm going to use the operator/variable in a while loop:
--------------------------------------------------------
While eval(cstr(vFollowUp) & cstr(vTest )& cstr(cDate(vStartWeekOnWhatDay))) and not oRS.EOF and not oRS.BOF
--------------------------------------------------------

As you can see, I've been trying multiple routes.

Thanks very much for any help that comes my way.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old March 1st, 2005, 07:14 PM
Registered User
Points: 22, Level: 1
Points: 22, Level: 1 Points: 22, Level: 1 Points: 22, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

O.k. since there doesn't seem to be an answer kicking around...

I'll resort to encapsulating the 2-3 scenario's in a if/else statement...

It is just much neater if I can check for the if/else and insert the proper operator >=< (kind of looks like a space ship)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old March 2nd, 2005, 03:46 AM
Friend of Wrox
Points: 386, Level: 6
Points: 386, Level: 6 Points: 386, Level: 6 Points: 386, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Denmark.
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

<%
vStartWeekOnWhatDayOriginal = "03/22/2005"
vFollowUp = "02/22/2005"
vTest = "<="
if eval(vStartWeekOnWhatDayOriginal & vTest & vFollowUp) = true then
    'The condition is true!
    response.Write "Yup, it's true!"
else
    'The condition is false!
    response.Write "Nope, it's false!"
end if
%>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
=== operator in c# surendraparashar C# 2005 8 November 8th, 2007 05:14 AM
Invalid operator for data type. Operator equals di Pusstiu SQL Server 2000 2 August 10th, 2007 05:51 AM
how to use like operator thillaiarasu SQL Server 2000 3 April 25th, 2007 09:53 AM
SQL 'Between' operator daveyh BOOK: Beginning SQL 2 April 4th, 2007 04:25 PM
Use of return operator. PC BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 July 1st, 2005 10:54 AM



All times are GMT -4. The time now is 12:20 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc