Example:
<object id=factory style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="smsx.cab#Version=6,5,439,30 VIEWASTEXT>
<param name="template" value="MeadCo://IE7" />
</object>
Technical blog discussing various programming languages, frameworks and paradigms. Code snippets and projects are also provided.
<object id=factory style="display:none"
classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
codebase="smsx.cab#Version=6,5,439,30 VIEWASTEXT>
<param name="template" value="MeadCo://IE7" />
</object>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Often times in code you want to assign one variable to another, but only if the variable is not null. If it is null, you want to populate the target variable with another ( perhaps default ) value. The code normally may look like this using the C# Conditional Operator:
string fileName = tempFileName !=null ? tempFileName : "Untitled;
If tempFileName is not null, fileName = tempFileName, else fileName = “Untitled“.
This can now be abbreviated as follows using the Null-Coalescing Operator:
string fileName = tempFileName ??"Untitled";
The logic is the same. If tempFileName is not null, fileName = tempFileName, else fileName = “Untitled“.
The Null-Coalescing Operator comes up a lot with nullable types, particular when converting from a nullable type to its value type:
int? count = null;
int amount = count ?? default(int);
Since count is null, amount will now be the default value of an integer type ( zero ).
These Conditional and Null-Coalescing Operators aren't the most self-describing operators :), but I do love programming in C#!
private void ModifyByFive(ref int number)
{
number += 5;
}
private void ModifyByFive(out int number)
{
number += 5;
}
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.run "regsvr32 /s DLLFILENAME.dll"
Set WshShell = nothing
Dim WshShell
Set WshShell = CreateObject("Wscript.Shell")
WshShell.run "regsvr32 /u/s DLLFILENAME.dll
Set WshShell = nothing