/// <summary> /// Function to lookup String data - used for string utility functions only /// </summary> /// <param name="dataName">Field Specification String</param> /// <param name="operation">Function Type Constants</param> /// <param name="details">Object containing search/lookup values. Becomes populated with results</param> /// <returns>The function returns a long which is the result code. This will be >= 0 if the function is successful, or < 0 in the case of an error</returns> public long AFDData(string dataName, long operation, ref afdStringData details) { StringBuilder passDetails = new StringBuilder(); long retVal; // Compose the DLL string from the supplied structure passDetails.Append(details.Lookup.PadRight(255, ' ')); passDetails.Append(details.Outcode.PadRight(4, ' ')); passDetails.Append(details.Incode.PadRight(3, ' ')); passDetails.Append(details.Search.PadRight(255, ' ')); passDetails.Append(details.Replace.PadRight(255, ' ')); // Call the DLL function string returnDetails = CallDllFunction(dataName, operation, passDetails, out retVal); // Retrieve the data structure from the string returned by the DLL details.Lookup = returnDetails.Substring(0, 255).Trim(); details.Outcode = returnDetails.Substring(255, 4).Trim(); details.Incode = returnDetails.Substring(259, 3).Trim(); details.Search = returnDetails.Substring(262, 255).Trim(); details.Replace = returnDetails.Substring(517, 255).Trim(); // Return with the function return value return(retVal); }
/// Procedure to clear AFDStringData Structure /// </summary> /// <param name="details">AFDData to be cleared</param> public void ClearAFDStringData(ref afdStringData details) { details.Lookup = string.Empty; details.Outcode = string.Empty; details.Incode = string.Empty; details.Search = string.Empty; details.Replace = string.Empty; }