473,224 Members | 1,607 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,224 software developers and data experts.

What Is This? > bool isClickInCell = hti.Column == this._columnNum && hti.Row > -1;

I'm trying to learn C#, and I came across the following:
bool isClickInCell = hti.Column == this._columnNum && hti.Row > -1;

What exactly is going on here?

As a Foxpro dude, this totally confounds me ;)

Thanks!

Steven
Dec 12 '05 #1
3 1058
It's a poorly parenthesized block that would be a bit more readable as:

bool isClickInCell = ((hti.Column == this._columnNum) && (hti.Row > -1));

or more so as an if block ala:

bool isClickInCell;
if((hti.Column == this._columnNum) && (hti.Row > -1))
{
isClickInCell = true;
}
else
{
isClickInCell = false;
}

In short... it’s determining if the desired column was hit, and having the
output of this logical operation (true or false) be returned and stored in
isClickInCell.

Is that a little more clear?

Brendan
"Steven C." wrote:
I'm trying to learn C#, and I came across the following:
bool isClickInCell = hti.Column == this._columnNum && hti.Row > -1;

What exactly is going on here?

As a Foxpro dude, this totally confounds me ;)

Thanks!

Steven

Dec 12 '05 #2
The equivalent code in longhand:

bool isClickInCell;
if (hti.Column == this._columnNum)
{
if (hti.Row > -1)
{
isClickInCell = true;
}
else
{
isClickInCell = false;
}
}
else
{
isClickInCell = false;
}

Dec 12 '05 #3
Thanks!
This helps. C# definitely aint Foxpro!

Thanks again;
Steven
On 12 Dec 2005 15:23:39 -0800, "Bruce Wood" <br*******@canada.com> wrote: The equivalent code in longhand:

bool isClickInCell;
if (hti.Column == this._columnNum)
{
if (hti.Row > -1)
{
isClickInCell = true;
}
else
{
isClickInCell = false;
}
}
else
{
isClickInCell = false;
}


Dec 13 '05 #4

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

Similar topics

1
by: Alex Vinokur | last post by:
------ foo.cpp ------ #include <vector> using namespace std; int main() { const vector<int> v1 (10); const vector<bool> v2 (10); &v1;
1
by: bluekite2000 | last post by:
In class Matrix, I rather have just virtual T& operator () (int i, int j) { } since virtual T& operator () (int i, int j) { } and
2
by: David W. Deley | last post by:
I've encountered some tags I'm not familiar with. <csscriptdict> <csobj > What are these tags and where can I find more info?
11
by: Joseph S. | last post by:
Hi all, how do I avoid typing the keyword "$this->" every time I need to reference a member of a class inside the class? (coming from a world of cozy auto-complete enabled Java / .Net IDEs I...
4
by: lizhuo | last post by:
hi all: I reading "C++ Templates: The Complete Guide " Part II: Templates in Depth he write: template<typename T> class B { public: enumE{e1=6,e2=28,e3=496}; virtual void zero(E e = e1);
3
by: kaleshwar | last post by:
Hello, I want to ask that what is the difference between to define #include<stdio.h> and #include" filename.c"
0
by: himanshu11 | last post by:
Hi All, What this command will do? exec 2>&1
1
by: howa | last post by:
Hi, How to accept bool value from stdin, using scanf? e.g. bool b ; scanf_s("%d", &b); It will show:
1
by: rnvipin | last post by:
Hi all, Please visit the link http://www.srishtiprojects.com/ncc/ncc_final.html It gives different previews for different screen resolutions and different browsers. Can Anyone align the...
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
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
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...

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.