Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Now I'm stumped
Message
From
01/05/2006 11:29:46
 
 
To
01/05/2006 08:56:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Miscellaneous
Thread ID:
01117847
Message ID:
01118048
Views:
18
Thanks Cetin,

That clears things up quite a bit. Coming from a VFP background, I'm finding C# not so difficult, but there are some subtleties that go over my head.


>>Forgive me, but I am but a complete newbie to .NET. Most of the syntax I can figure out on my own, but this one has me really puzzled: this.GetOrderDetail((int?)e.PrimaryKeyValue);
>>
>>Why is int? in parens? Why is there a question mark after int? Am I confusing anybody else besides myself?
>>
>>I'm going to go out on a limb here, but I'm guessing that e.PrimaryKeyvalue is being typed as int. Correct me if I'm wrong.
>>
>>Jim
>
>Jim,
>You are coming from VFP so saying it with VFP example might work better.
>Consider you have a new record in buffer. A field's OLDVAL() is null (record is new no valid oldvalue). Also consider it's of type integer.
>
>(int)e.PrimaryKeyValue
>
>casts e.PrimaryKeyValue to an integer. Having ? tells that it could be null.
>
>int? x = null;
>
>would not work if nullable types didn't exist (like it didn't in .Net 1.1). Before you could only use nulls with reference types (ie: string).
>You wouldn't be also able to compare if int x is null (because they were not nullable before).
>
>?? operator lets you check types being null with a shorthand notation. ie: If x is null consider x is 100, else whatever it has the value (VFP: nvl(x,100)):
>
>y = x ?? 100;
>
>Also check Nullable class.
>Cetin
Previous
Reply
Map
View

Click here to load this message in the networking platform