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.
|