470,636 Members | 1,507 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,636 developers. It's quick & easy.

Boolean variable concatination problem

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

Jul 19 '05 #1
5 7546
> what should i do to get True in mystr what ever the Language of windows
is.

Uh, use a string?

Flag = "True"
Jul 19 '05 #2


asim wrote:
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>"
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 19 '05 #3
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

"Martin Honnen" <Ma***********@t-online.de> wrote in message
news:Oy*************@tk2msftngp13.phx.gbl...


asim wrote:
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>"
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 19 '05 #4
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.

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"asim" <qa**@advcomm.net> wrote in message
news:eh****************@TK2MSFTNGP11.phx.gbl...
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

"Martin Honnen" <Ma***********@t-online.de> wrote in message
news:Oy*************@tk2msftngp13.phx.gbl...


asim wrote:
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>"
--

Martin Honnen
http://JavaScript.FAQTs.com/


Jul 19 '05 #5
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!"
"Mark Schupp" <ms*****@ielearning.com> wrote in message
news:#F**************@tk2msftngp13.phx.gbl...
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.

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Ramprasad A Padmanabhan | last post: by
2 posts views Thread by BobAchgill | last post: by
8 posts views Thread by Jerry | last post: by
76 posts views Thread by KimmoA | last post: by
reply views Thread by pradeep | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.