Boolean variable concatination problem

A

asim

Hi
if a declare a variale say
Dim Flag
and assing it to true a boolean value
Flag = True
and if i try to concatinate it with another string like
mystr="<my-str>" & Flag & "</my-str>"
and if the machine is non english the mystr will contain something like
<my-str>that language characters</my-str>

what should i do to get True in mystr what ever the Language of windows is.

Qazi Asim
 
A

Aaron Bertrand - MVP

what should i do to get True in mystr what ever the Language of windows
is.

Uh, use a string?

Flag = "True"
 
M

Martin Honnen

asim said:
if a declare a variale say
Dim Flag
and assing it to true a boolean value
Flag = True
and if i try to concatinate it with another string like
mystr="<my-str>" & Flag & "</my-str>"
and if the machine is non english the mystr will contain something like
<my-str>that language characters</my-str>

what should i do to get True in mystr what ever the Language of windows is.

I had hoped setting Response.LCID would solve that but it doesn't, maybe
the best is to write a function solving the problem

Function ToBooleanString (value)
Dim b
b = CBool(value)
If b Then
ToBooleanString = "True"
Else
ToBooleanString = "False"
End If
End Function
Dim Flag
Flag = True
Response.Write ToBooleanString(Flag) & "<br>"
Flag = Not(Flag)
Response.Write ToBooleanString(Flag) & "<br>"
 
A

asim

Thankx for the answer .. surely it will solve my problem but i have 1700 ASP
pages it wiull be a two months work to find and change all the boolean true
to String True .. is there any other Alternative way ??

Qazi Asim
 
M

Mark Schupp

Do you ever use the value as a true Boolean?

If not you can change all instances of True to "True" using a global text
replace tool. Many are available as shareware.
 
A

Aaron Bertrand - MVP

Even if the variable is used as a boolean in ASP, this should still work:

a = "True"
if a then response.write "Yay, a is true!"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top