Boolean variable concatination problem

Discussion in 'ASP General' started by asim, Nov 14, 2003.

  1. asim

    asim Guest

    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
    asim, Nov 14, 2003
    #1
    1. Advertising

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

    Uh, use a string?

    Flag = "True"
    Aaron Bertrand - MVP, Nov 14, 2003
    #2
    1. Advertising

  3. 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/
    Martin Honnen, Nov 14, 2003
    #3
  4. asim

    asim Guest

    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" <> wrote in message
    news:...
    >
    >
    > 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/
    >
    asim, Nov 15, 2003
    #4
  5. asim

    Mark Schupp Guest

    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" <> wrote in message
    news:eh8l$%...
    > 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" <> wrote in message
    > news:...
    > >
    > >
    > > 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/
    > >

    >
    >
    Mark Schupp, Nov 17, 2003
    #5
  6. 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" <> wrote in message
    news:#F#...
    > 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.
    Aaron Bertrand - MVP, Nov 17, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jakob Simon-Gaarde

    Preprocessor concatination of defines

    Jakob Simon-Gaarde, Jul 1, 2004, in forum: C++
    Replies:
    4
    Views:
    434
    Jack Klein
    Jul 2, 2004
  2. JChG
    Replies:
    1
    Views:
    239
    Steven D'Aprano
    Apr 19, 2010
  3. Noah Roberts
    Replies:
    5
    Views:
    741
    James Kanze
    Jan 12, 2011
  4. Rajika Somasiri

    String concatination

    Rajika Somasiri, Feb 9, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    131
    Tom Kiefer
    Feb 9, 2004
  5. Rajika Somasiri

    String concatination

    Rajika Somasiri, Feb 9, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    106
    Anusha Nanayakkara
    Feb 23, 2004
Loading...

Share This Page