Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Boolean variable concatination problem

Reply
Thread Tools

Boolean variable concatination problem

 
 
asim
Guest
Posts: n/a
 
      11-14-2003
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





 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      11-14-2003
> what should i do to get True in mystr what ever the Language of windows
is.

Uh, use a string?

Flag = "True"


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-14-2003


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/

 
Reply With Quote
 
asim
Guest
Posts: n/a
 
      11-15-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> 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/
>



 
Reply With Quote
 
Mark Schupp
Guest
Posts: n/a
 
      11-17-2003
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" <(E-Mail Removed)> wrote in message
news:eh8l$%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> >
> > 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/
> >

>
>



 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      11-17-2003
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" <(E-Mail Removed)> wrote in message
news:#F#(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatination creates invalid preprocessor parameter? Noah Roberts C++ 5 01-12-2011 11:03 AM
Subtle difference between boolean value and boolean comparison? Metre Meter Javascript 7 08-06-2010 08:40 PM
The ole Repetion != Concatination pitfall JChG Python 1 04-19-2010 04:48 AM
difference between 'boolean' and 'java.lang.Boolean' J Leonard Java 4 01-19-2008 02:56 AM
Preprocessor concatination of defines Jakob Simon-Gaarde C++ 4 07-02-2004 03:17 AM



Advertisments