473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

PHP Boolean Values like ASP

I'm traing to rewrite a part of code i've made in for ASP in PHP.

ASP:
If moneda = True Then
moneda = False
Else
moneda = NOT moneda
End If

This change the value of the variable from true to false and the other
way arround.

My problem is that PHP asumes that Null value is also False value.
So, I need three instances of the variable; when the variable was not
already user, to asume the Null value. If the value is Null, then to
change it to True, and when it is True to change it to false.
How can I solve this PHP misunderstud between Null and False value?

Thanks!
ELMICHA
Jul 16 '05 #1
5 6262

"Micha" <mi*******@tutopia.com> wrote in message
news:12**************************@posting.google.c om...
I'm traing to rewrite a part of code i've made in for ASP in PHP.

ASP:
If moneda = True Then
moneda = False
Else
moneda = NOT moneda
End If

This change the value of the variable from true to false and the other
way arround.

My problem is that PHP asumes that Null value is also False value.
So, I need three instances of the variable; when the variable was not
already user, to asume the Null value. If the value is Null, then to
change it to True, and when it is True to change it to false.
How can I solve this PHP misunderstud between Null and False value?

Thanks!
ELMICHA


Try:

if moneda === true
moneda = false;
else
moneda = true;

Jul 16 '05 #2

"Phlarmf" <no@email.com> wrote in message
news:rSj9b.6014$VS2.5155@pd7tw1no...

"Micha" <mi*******@tutopia.com> wrote in message
news:12**************************@posting.google.c om...
I'm traing to rewrite a part of code i've made in for ASP in PHP.

ASP:
If moneda = True Then
moneda = False
Else
moneda = NOT moneda
End If

This change the value of the variable from true to false and the other
way arround.

My problem is that PHP asumes that Null value is also False value.
So, I need three instances of the variable; when the variable was not
already user, to asume the Null value. If the value is Null, then to
change it to True, and when it is True to change it to false.
How can I solve this PHP misunderstud between Null and False value?

Thanks!
ELMICHA


Try:

if moneda === true
moneda = false;
else
moneda = true;


man... it's too early Monday... I forgot the braces on the if

if (moneda === true)


Jul 16 '05 #3
Micha wrote:
I'm traing to rewrite a part of code i've made in for ASP in PHP.

ASP:
If moneda = True Then
moneda = False
Else
moneda = NOT moneda
End If

This change the value of the variable from true to false and the other
way arround.


$bMoneda = $bMoneda ? false : true;

--
Dado

What this world needs is a good five-dollar plasma weapon.
Jul 16 '05 #4
Micha writes:
How can I solve this PHP misunderstud between Null and False value?


Do you know about the === and !== operators? They test for equality
of both value and type. So the expression (false === null ) evaluates
to false.

--

__o Alex Farran
_`\<,_ Analyst / Programmer
(_)/ (_) www.alexfarran.com

Jul 16 '05 #5
Alex Farran <al**@alexfarran.com> wrote in message news:<m3************@alexfarran.com>...
Micha writes:
How can I solve this PHP misunderstud between Null and False value?


Do you know about the === and !== operators? They test for equality
of both value and type. So the expression (false === null ) evaluates
to false.


It worked fine!!
Thanks to all...
Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Julian Hershel | last post by:
Hi. I want to to use the xs:boolean type for one of my elements. But is it possible to make these boolean values be read as Yes/No instead of true/false? Should I create a custom type for that?...
8
by: FrancisC | last post by:
how to define Boolean in C ? boolean abc; ??? is it default as True or False??
17
by: jacob navia | last post by:
The section about boolean values should mention <stdbool.h> at least. It is still at the C89 stage... (Section 9)
8
by: Metro Sauper | last post by:
Why is the default text representation for booleans in C# 'True' and 'False' whereas in xml it is 'true' and 'false'? It seems like it would make sense to have them both the same. Metro T....
0
by: Robert Love | last post by:
I am trying to save some boolean values from checkboxes using isolated storage. I am able to do strings and integers without a problem but I can't work out how to save boolean values without seeing...
0
by: ECathell | last post by:
Ok this may be a silly question...but here goes... I need to extend the boolean type. the reason for this is I have a base collection that has boolean properties. Then my inherited class has...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
0
by: Genken | last post by:
Hi ALL I currently have a project where i have to redefine certain table fields and their data types. The problem is i have fields to mimic or duplicate an access table, but the problem is that...
6
by: =?iso-8859-2?Q?Marcin_Dzi=F3bek?= | last post by:
Hi All: I need to get (filter in) some dataview's rows with DBNULLs in column of boolean type: Actually to get the only rows with DBNULL, I use code like this: DV.RowFilter =...
19
by: tshad | last post by:
I have a value in my sql table set to tinyint (can't set to bit). I am trying to move it into a boolean field in my program and have tried: isTrue = (int)dbReader and isTrue =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.