473,725 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7743
> 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******** *****@tk2msftng p13.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.n et> wrote in message
news:eh******** ********@TK2MSF TNGP11.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******** *****@tk2msftng p13.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*****@ielear ning.com> wrote in message
news:#F******** ******@tk2msftn gp13.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1979
by: JS | last post by:
I am trying to add an element to an array like this: var ty = ; zz = "ty"; var ab = null; zz+=""; ab = eval(zz); document.write(ab.length);
10
8616
by: Ramprasad A Padmanabhan | last post by:
Hello all, On my linux box ( redhat 7.2 ), I have been using char as a boolean data type. In order to save on the number of bytes as compared to using int or short int. typedef char boolean; boolean x; x=1;
11
5351
by: Darren Anderson | last post by:
I have a function that I've tried using in an if then statement and I've found that no matter how much reworking I do with the code, the expected result is incorrect. the code: If Not (strIn.Substring(410, 10).Trim = "") Then 'Something processed Else 'Something processed
2
1763
by: BobAchgill | last post by:
I tried to use either a CheckBox or Radio Button to set a Boolean variable but I get Cast error message with either when I try to use the Boolean in an IF statement. How can I use the Check box control to set the Boolean and not get a cast error later in the code with I try to use the Boolean in an If statement? Thanks!
8
2842
by: Jerry | last post by:
I am a MySQL and PHP newbie. I am having trouble getting the $w variable in my code below passed to mysql. When I use the value of $w directly in the Where clause, the correct rows are returned. However, when I try to use the variable in the Where clause, either an error occurs or no rows are returned. Any thoughts greatly appreciated! I am using php-4.4.2 and MySQL-4.1.18-0 on Suse 9.1 Jerry
76
4909
by: KimmoA | last post by:
First of all: I love C and think that it's beautiful. However, there is at least one MAJOR flaw: the lack of a boolean type. OK. Some of you might refer to C99 and its _Bool (what's up with the uppercase 'B' anyway?) and the header you can include (apparently) to get a real "bool". This isn't my point, however -- it should have been there from the beginning. char is a small int. We all know that. However, "char some_bool = 0;" simply...
0
2336
by: pradeep | last post by:
Hello, I have problem in PHP String concatination with html select combo box. There are 3 files addressbook.sql : concat1.php concat2.php
3
3960
by: c2 | last post by:
hi, i face a problem when click the icon , my login will prompt this message String was not recognized as a valid Boolean See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.FormatException: String was not recognized as a valid Boolean.
3
3950
by: waqasahmd | last post by:
Hi, I have this code in my pageload but the problem is i want rm_id which i am gettin from session should be set in the javascript code in place of 261 hard code value at line#5( var rmid = 261;) i use concatination opr but it dose'nt work out. int rm_id = Convert.ToInt32(Session); //var rmid = <%= Convert.ToInt32(Session) %> string updateParentScript = @"function updateParentWindow() {...
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.