473,219 Members | 2,011 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,219 software developers and data experts.

when to use 2 equal signs and when to use 3

When I had these two lines in my code:
if ($executed == "The command didn't exist") {
$this->core->error("In CommandRenderAllActionsInAnArray we sought
the command '$commandName' but ExteriorCommands could not find it. It
returned the value: '$executed'.", "CommandRenderAllActionsInAnArray");

I was getting this on screen:
# CommandRenderAllActionsInAnArray threw this error: In
CommandRenderAllActionsInAnArray we sought the command
'checkToSeeIfThisIsTheFirstLogin' but ExteriorCommands could not find
it. It returned the value: '1'.



But if I change the first line to this:
if ($executed === "The command didn't exist") {

then it works correctly.
Why does this need 3 equal signs? Why doesn't 2 suffice? I've done
string comparisons before and I've never had to use 3 equal signs
before.

Aug 7 '05 #1
2 5821
lk******@geocities.com wrote:
Why does this need 3 equal signs? Why doesn't 2 suffice? I've done
string comparisons before and I've never had to use 3 equal signs
before.


Have a close look at $executed. My guess is that it contains a boolean and
because a non-empty string equals boolean true with the lose ==
comparisation, you are getting the unexpected result. with === you are not
only comparing the values but also the types.
JW


Aug 7 '05 #2
>>>>>>>>>>>>>>>
Why does this need 3 equal signs? Why doesn't 2 suffice? I've done
string comparisons before and I've never had to use 3 equal signs
before.


Have a close look at $executed. My guess is that it contains a boolean
and
because a non-empty string equals boolean true with the lose ==
comparisation, you are getting the unexpected re
>>>>>>>>>>>


In other words, if $executed is boolean true, it doesn't matter what
the string is that I'm comparing it to, it still makes the if statement
acts as if the statement is true?

Aug 15 '05 #3

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

Similar topics

7
by: flm | last post by:
I've got an XML document that contains euro signs and looks like : <?xml version="1.0" encoding="utf-8"?> <merchant id="52"> <product offerid="03543068131" deliverycost="6,90 " /> ....
8
by: Murt | last post by:
Hi, when writing equations in vb .net, how do you enter the signs "less than or equal to" etc. thanks Murt
17
by: Martin | last post by:
Below is some sample code to illustrate two warnings I get using a Hitachi compiler. When I use the GCC compiler I get a clean compile. I'd be grateful if someone could explain what the warnings...
1
by: Ine Embrechts | last post by:
I have a asp.net website based on an SQL Server database. There are texts in 8 languages in it. But I have problems showing the polish signs. How can I fix this? *** Sent via Developersdex...
17
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are...
3
by: Paul E Collins | last post by:
In Visual Studio 2005, I copy a block of code with tabs in it, such as: myLabel.Text = "Please wait ..."; progressBar.Value = 0; (In the above, the two = signs are aligned with each other...
32
by: David Mark | last post by:
I've got a collection of functions that accept a function or object (paired with a method name) as a callback. For the longest time I have relied on this test. (typeof cb == 'function') ...
14
by: gimme_this_gimme_that | last post by:
What is going on here with the dollar signs and parenthesis? $(document).ready(function(){ $("li").behavior("click",function(){ $(this).load(menu.html"); }); }); And when do you use click...
0
by: RobR2009 | last post by:
I am having trouble with a C# proxy page I am writing which allows me to do cross domain AJAX calls with Javascript. The problem is with certain pages that contain pound signs that are not HTML...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.