Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable not listening to instructions?

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi

After some playing around, I have the following code. I want variable 12 (which is switch in the query string) to become null ("") after being processed, but it wont. Why???

Code:
<%
Dim variable1, variable2, variable3, variable4, variable5, variable6, variable7, variable8, variable9, variable10, variable11, variable12, variablex, variabley, variablestring

variable1 = Request.QueryString(&quot;tfc&quot;)
variable2 = Request.QueryString(&quot;tfs&quot;)
variable3 = Request.QueryString(&quot;bc&quot;)
variable4 = Request.QueryString(&quot;txfc&quot;)
variable5 = Request.QueryString(&quot;txfs&quot;)
variable6 = Request.QueryString(&quot;lc&quot;)
variable7 = Pageref
variable8 = Pagerefold


If Request.QueryString(&quot;switch&quot;) = &quot;off&quot; then  
   Variable10 = &quot;off&quot;
ElseIf Request.QueryString(&quot;switch&quot;) = &quot;on&quot; then 
   Variable10 = &quot;on&quot;
ElseIf Request.QueryString(&quot;switch&quot;) = &quot;&quot; Then
   Variable10 = &quot;&quot;
End If

If variable10 = &quot;&quot; then
'Do nothing
ElseIf variable10 = &quot;on&quot; Then
variablex = &quot;on&quot;
Else
Variablex = &quot;off&quot;
End If

variable12 = &quot;&quot;

variablestring = &quot;?tfc=&quot; & variable1 &&quot;&amp;tfs=&quot; & variable2 & &quot;&amp;bc=&quot; & variable3 & &quot;&amp;txfc=&quot; & variable4 & &quot;&amp;txfs=&quot; & variable5 & &quot;&amp;lc=&quot; & variable6 & &quot;&amp;Pageref=&quot; & variable7 & &quot;&amp;Pagerefold=&quot; & variable8 & &quot;&amp;Access=&quot; & variablex & &quot;&amp;test=&quot; & variabley & &quot;&amp;Switch=&quot; & variable12

%>

Cheers

James
 
&quot;&quot; and null are different values.

if you want the varible to be null you need to give it that value
variable12 = null

I'm a bit confused though. how exactely does it not give a variable a empty string when that is indeed what it already has?

____________________________________________________
[sub][/sub]
onpnt2.gif

 
Hi,

I want the variable to be nothing, aka null aka &quot;&quot;

I want the string to be sent like this (edited for shortness)
Code:
&Access=&Switch=on

And for it come back in the string as
Code:
&Access=on&Switch=

But at present, I am having to click the link (which has the string attached) twice in order for it to work, otherwise it comes back as
Code:
&Access=&Switch=on

James

 
Hi,

Fixed it, I was refreshing the page without giving the variables a chance to do their magic

James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top