/// <summary> /// Receives two objects as parameters and returns the one which is not null. If both of them are null /// then returns a null, if the first one is not null then returns the first object. /// <pre> /// Example: /// string myNullObj; //The string is not initialized yet /// VFPToolkit.common.NVL("mystring", myNullObj); //returns mystring object /// Note: All strings, int, long etc. all of them are objects /// </summary> /// <param name="oExp1"></param> /// <param name="oExp2"></param> /// <returns></returns> public static object NVL(object oExp1, object oExp2) { //if oExp1 is not null then return oExp1 if (oExp1 != null) { return oExp1; } else if ((oExp1 == null) && (oExp2 != null)) { //If oExp1 is null return oExp2 return oExp2; } else //If both of them are null return nothing return null; }I think the source code is available in VB also. If you are not familiar with the Visual FoxPro Toolkit for .NET I would recomend taking a look at it. (http://foxcentral.net/microsoft/VFPToolkitNET.htm)