int startOffset = (totalEmployees > 0) ?
(empGrid.CurrentPageIndex*empGrid.PageSize+1) : 0;
I can't find any reference to the ? syntax
any web reference would be appreciate..
many thanks
huzz - 28 Feb 2005 12:21 GMT
I done a search .. and found this.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclr
fconditionaloperator.asp
> int startOffset = (totalEmployees > 0) ?
> (empGrid.CurrentPageIndex*empGrid.PageSize+1) : 0;
[quoted text clipped - 4 lines]
>
> many thanks
Cor Ligthert - 28 Feb 2005 12:24 GMT
Huzz,
You mean this one?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vclr
fconditionaloperator.asp
I hope this helps?
Cor
huzz - 28 Feb 2005 12:41 GMT
Thanks Cor..
> Huzz,
>
[quoted text clipped - 5 lines]
>
> Cor
cody - 28 Feb 2005 13:43 GMT
It is the ternary operator. It is the same as writing:
int startOffset;
if (totalEmployees > 0)
startOffset = empGrid.CurrentPageIndex*empGrid.PageSize+1;
else
startOffset = 0;
> int startOffset = (totalEmployees > 0) ?
> (empGrid.CurrentPageIndex*empGrid.PageSize+1) : 0;
[quoted text clipped - 4 lines]
>
> many thanks