Boolean variable concatination problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • asim

    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





  • Aaron Bertrand - MVP

    #2
    Re: Boolean variable concatination problem

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

    Uh, use a string?

    Flag = "True"


    Comment

    • Martin Honnen

      #3
      Re: Boolean variable concatination problem



      asim wrote:[color=blue]
      > 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.[/color]

      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


      Comment

      • asim

        #4
        Re: Boolean variable concatination problem

        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" <Martin.Honnen@ t-online.de> wrote in message
        news:OyiomdrqDH A.512@tk2msftng p13.phx.gbl...[color=blue]
        >
        >
        > asim wrote:[color=green]
        > > 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[/color][/color]
        is.[color=blue]
        >
        > 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/
        >[/color]


        Comment

        • Mark Schupp

          #5
          Re: Boolean variable concatination problem

          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
          Advancing limitless knowledge and continual growth to create confident problem solvers, one course at a time.



          "asim" <qazi@advcomm.n et> wrote in message
          news:eh8l$%23xq DHA.3612@TK2MSF TNGP11.phx.gbl. ..[color=blue]
          > Thankx for the answer .. surely it will solve my problem but i have 1700[/color]
          ASP[color=blue]
          > pages it wiull be a two months work to find and change all the boolean[/color]
          true[color=blue]
          > to String True .. is there any other Alternative way ??
          >
          > Qazi Asim
          >
          >
          >
          > "Martin Honnen" <Martin.Honnen@ t-online.de> wrote in message
          > news:OyiomdrqDH A.512@tk2msftng p13.phx.gbl...[color=green]
          > >
          > >
          > > asim wrote:[color=darkred]
          > > > 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[/color][/color][/color]
          like[color=blue][color=green][color=darkred]
          > > > <my-str>that language characters</my-str>
          > > >
          > > > what should i do to get True in mystr what ever the Language of[/color][/color][/color]
          windows[color=blue]
          > is.[color=green]
          > >
          > > 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/
          > >[/color]
          >
          >[/color]


          Comment

          • Aaron Bertrand - MVP

            #6
            Re: Boolean variable concatination problem

            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" <mschupp@ielear ning.com> wrote in message
            news:#F#9zHTrDH A.1444@tk2msftn gp13.phx.gbl...[color=blue]
            > 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.[/color]


            Comment

            Working...