Setting text values

  • Thread starter Thread starter Mettá
  • Start date Start date
M

Mettá

Why does this not work, or rather how do I get it to work?

<%
Dim ltype
Dim chgt

<% If FP_FieldVal(fp_rs,"textfield")="some text" Then ltype="xxx text" &
chgt="7.50" %>
<% If FP_FieldVal(fp_rs,"textfield")="some other text" Then ltype=" other
xxx text" & chgt="35.00"

End if
%>

Thanks
M
 
Why does this not work,

Probably because

chgt="7.50" is not a string, and you're trying to concatenate it to another
string, which you're attempting to assign to a variable named "ltype."
how do I get it to work?

Learning VBScript would be a good idea! As to how to get it to "work," it
all depends on what you want to do. Since you've only posted bad/meaningless
code, without any mention of what you want the code to do, it is not
possible to tell you how to get it to work without reading your mind, or you
telling us what you want it to do.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
Ug, I consider myself told. : ~((

I was trying to create two strings depending one the text values of a db
result field
Sort of ... if a=apples then set b="oranges" and c="lemons"

Thanks
M

--
---
Kevin Spencer said:
Why does this not work,

Probably because

chgt="7.50" is not a string, and you're trying to concatenate it to
another string, which you're attempting to assign to a variable named
"ltype."
how do I get it to work?

Learning VBScript would be a good idea! As to how to get it to "work," it
all depends on what you want to do. Since you've only posted
bad/meaningless code, without any mention of what you want the code to do,
it is not possible to tell you how to get it to work without reading your
mind, or you telling us what you want it to do.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
I'm going to step way out on a limb, and guess what you want it to do:

<%
If FP_FieldVal(fp_rs,"textfield")="some text" Then
ltype="xxx text"
chgt="7.50"
End If %>
If FP_FieldVal(fp_rs,"textfield")="some other text" Then
ltype=" other xxx text"
chgt="35.00"
End If
%>

And here is a link to the complete online MSDN VBScript Language reference:

http://msdn.microsoft.com/library/en-us/script56/html/vtoriVBScript.asp?frame=true

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
Correction:

<%
If FP_FieldVal(fp_rs,"textfield")="some text" Then
ltype="xxx text"
chgt="7.50"
End If
If FP_FieldVal(fp_rs,"textfield")="some other text" Then
ltype=" other xxx text"
chgt="35.00"
End If
%>

(Unmatched scripting tag in original)
--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.
 
Back
Top