PageRenderTime 54ms CodeModel.GetById 3ms app.highlight 39ms RepoModel.GetById 1ms app.codeStats 1ms

/Spss/SpssSafeWrapper.cs

#
C# | 1990 lines | 483 code | 35 blank | 1472 comment | 49 complexity | 64713a1d4b30e9c4fc1db0fe322ff097 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1using System;
   2using System.Runtime.InteropServices;
   3
   4namespace Spss
   5{
   6
   7	/// <summary>
   8	/// Very thin SpssSafeWrapper class for functions exposed by spssio32.dll.
   9	/// </summary>
  10	[CLSCompliant(false)]
  11	public class SpssSafeWrapper : SpssThinWrapper
  12	{
  13		/// <summary>
  14		/// Creates an instance of the <see cref="SpssSafeWrapper"/> class.
  15		/// </summary>
  16		protected SpssSafeWrapper()
  17		{
  18		}
  19
  20		// These lengths were extracted from the SPSS documentation 
  21		// rather than any header file.
  22		public const int SPSS_GUID_LENGTH = 256;
  23		public const int SPSS_SYSTEM_STRING_LENGTH = 41;
  24		public const int SPSS_MAX_TEXTINFO = 255;
  25		public const int SPSS_DATESTAMP_LENGTH = 9;
  26		public const int SPSS_TIMESTAMP_LENGTH = 8;
  27
  28		#region veg
  29
  30		public static Int32 SPSS_STRING(Int32 size)
  31		{
  32			return size;
  33		}
  34
  35		public const Int32 SPSS_NUMERIC = 0;
  36
  37		#endregion veg
  38
  39		/// <summary>
  40		/// Opens an SPSS file for reading.
  41		/// </summary>
  42		/// <param name="fileName">
  43		/// Name of the file.
  44		/// </param>
  45		/// <param name="handle">
  46		/// The handle to the opened file.
  47		/// </param>
  48		/// <returns>
  49		/// <see cref="ReturnCode.SPSS_OK"/>,
  50		/// <see cref="ReturnCode.SPSS_FITAB_FULL"/>,
  51		/// <see cref="ReturnCode.SPSS_FILE_OERROR"/>,
  52		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>,
  53		/// <see cref="ReturnCode.SPSS_FILE_RERROR"/>,
  54		/// <see cref="ReturnCode.SPSS_INVALID_FILE"/>,
  55		/// <see cref="ReturnCode.SPSS_NO_TYPE2"/>, or
  56		/// <see cref="ReturnCode.SPSS_NO_TYPE999"/>.
  57		/// </returns>
  58		/// <remarks>
  59		/// This function opens an SPSS data file for reading and returns a handle that should be
  60		/// used for subsequent operations on the file.
  61		/// Files opened with spssOpenRead should be closed with <see cref="SpssThinWrapper.spssCloseReadDelegate"/>.
  62		/// </remarks>
  63		public static ReturnCode spssOpenRead(string fileName, out int handle)
  64		{
  65			return SpssThinWrapper.spssOpenReadImpl(ref fileName, out handle);
  66		}
  67		/// <summary>
  68		/// Creates an empty SPSS file.
  69		/// </summary>
  70		/// <param name="fileName">
  71		/// Name of the file.
  72		/// </param>
  73		/// <param name="handle">
  74		/// The handle to the new file.
  75		/// </param>
  76		/// <returns>
  77		/// <see cref="ReturnCode.SPSS_OK"/>,
  78		/// <see cref="ReturnCode.SPSS_FITAB_FULL"/>,
  79		/// <see cref="ReturnCode.SPSS_FILE_OERROR"/>,
  80		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>,
  81		/// </returns>
  82		/// <remarks>
  83		/// This function opens a file in preparation for creating a new SPSS data file and returns a
  84		/// handle that should be used for subsequent operations on the file.
  85		/// Files opened with spssOpenWrite should be closed with <see cref="SpssThinWrapper.spssCloseWriteDelegate"/>.
  86		/// </remarks>
  87		public static ReturnCode spssOpenWrite(string fileName, out int handle)
  88		{
  89			return SpssThinWrapper.spssOpenWriteImpl(ref fileName, out handle);
  90		}
  91		/// <summary>
  92		/// Reports the name of the case weight variable.
  93		/// </summary>
  94		/// <param name="handle">
  95		/// Handle to the data file.
  96		/// </param>
  97		/// <param name="varName">
  98		/// The name of the case weight variable.
  99		/// </param>
 100		/// <returns>
 101		/// <see cref="ReturnCode.SPSS_OK"/>,
 102		/// <see cref="ReturnCode.SPSS_NO_CASEWGT"/>,
 103		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>, or
 104		/// <see cref="ReturnCode.SPSS_INVALID_CASEWGT"/>.
 105		/// </returns>
 106		/// <remarks>
 107		/// This function reports the name of the case weight variable. 
 108		/// </remarks>
 109		public static ReturnCode spssGetCaseWeightVar(int handle, out string varName)
 110		{
 111			varName = new string(' ', SPSS_MAX_VARNAME + 1);
 112			ReturnCode result = SpssThinWrapper.spssGetCaseWeightVarImpl(handle, ref varName);
 113			varName = (result == ReturnCode.SPSS_OK) ? varName.Substring(0, varName.IndexOf('\0')) : null;
 114			return result;
 115		}
 116		/// <summary>
 117		/// Retrieves the first block of SPSS Data Entry information from a data file.
 118		/// </summary>
 119		/// <param name="handle">
 120		/// Handle to the data file.
 121		/// </param>
 122		/// <param name="data">
 123		/// Data from the file.
 124		/// </param>
 125		/// <param name="maxData">
 126		/// Maximum bytes to return.
 127		/// </param>
 128		/// <returns>
 129		/// <see cref="ReturnCode.SPSS_OK"/>,
 130		/// <see cref="ReturnCode.SPSS_NO_DEW"/>,
 131		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>, or
 132		/// <see cref="ReturnCode.SPSS_FILE_BADTEMP"/>.
 133		/// </returns>
 134		/// <remarks>
 135		/// The client can retrieve DEW information (file information that is private to the SPSS
 136		/// Data Entry product) from a file in whatever increments are convenient. The first such
 137		/// increment is retrieved by calling spssGetDEWFirst, and subsequent segments are
 138		/// retrieved by calling spssGetDEWNext as many times as necessary. As with
 139		/// spssGetDEWInfo, spssGetDEWFirst will return SPSS_NO_DEW if the file was written
 140		/// with a byte order that is the reverse of that of the host.
 141		/// </remarks>
 142		public static ReturnCode spssGetDEWFirst(int handle, out string data, int maxData)
 143		{
 144			data = new string(' ', maxData);
 145			int len;
 146			ReturnCode result = SpssThinWrapper.spssGetDEWFirstImpl(handle, ref data, data.Length, out len);
 147			data = (result == ReturnCode.SPSS_OK) ? data.Substring(0, len) : null;
 148			return result;
 149		}
 150		/// <summary>
 151		/// Gets the Data Entry GUID from a data file.
 152		/// </summary>
 153		/// <param name="handle">
 154		/// Handle to the data file.
 155		/// </param>
 156		/// <param name="asciiGUID">
 157		/// The file's GUID in character form or a null string if the
 158		/// file contains no GUID.
 159		/// </param>
 160		/// <returns>
 161		/// <see cref="ReturnCode.SPSS_OK"/> or
 162		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>.
 163		/// </returns>
 164		/// <remarks>
 165		/// Data Entry for Windows maintains a GUID in character form as a uniqueness indicator.
 166		/// Two files have identical dictionaries and DEW information if they have the same
 167		/// GUID. Note that the spssOpenWriteCopy function will not copy the source file’s
 168		/// GUID. spssGetDEWGUID allows the client to read a file’s GUID, if any. 
 169		/// </remarks>
 170		public static ReturnCode spssGetDEWGUID(int handle, out string asciiGUID)
 171		{
 172			asciiGUID = new string(' ', SPSS_GUID_LENGTH + 1);
 173			ReturnCode result = SpssThinWrapper.spssGetDEWGUIDImpl(handle, ref asciiGUID);
 174			// Although we search for a null terminator, the documentation
 175			// tells us that the GUID is always SPSS_GUID_LENGTH, so we COULD
 176			// just terminate the string there to trim off the null terminator that is
 177			// artificially put there.
 178			asciiGUID = (result == ReturnCode.SPSS_OK) ? asciiGUID.Substring(0, asciiGUID.IndexOf('\0')) : null;
 179			return result;
 180		}
 181		/// <summary>
 182		/// Retrieves the next block of SPSS Data Entry information from a data file.
 183		/// </summary>
 184		/// <param name="handle">
 185		/// Handle to the data file.
 186		/// </param>
 187		/// <param name="data">
 188		/// Data from the file.
 189		/// </param>
 190		/// <param name="maxData">
 191		/// Maximum bytes to return.
 192		/// </param>
 193		/// <returns>
 194		/// <see cref="ReturnCode.SPSS_OK"/>,
 195		/// <see cref="ReturnCode.SPSS_DEW_NOFIRST"/>,
 196		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>, or
 197		/// <see cref="ReturnCode.SPSS_FILE_BADTEMP"/>.
 198		/// </returns>
 199		/// <remarks>
 200		/// The client can retrieve DEW information (file information that is private to the SPSS
 201		/// Data Entry product) from a file in whatever increments are convenient. The first such
 202		/// increment is retrieved by calling <see cref="spssGetDEWFirst"/>, and subsequent segments are
 203		/// retrieved by calling spssGetDEWNext as many times as necessary. As with
 204		/// <see cref="SpssThinWrapper.spssGetDEWInfoDelegate"/>, <see cref="spssGetDEWFirst"/> will return SPSS_NO_DEW if the file was written
 205		/// with a byte order that is the reverse of that of the host.
 206		/// </remarks>
 207		public static ReturnCode spssGetDEWNext(int handle, out string data, int maxData)
 208		{
 209			data = new string(' ', maxData);
 210			int len;
 211			ReturnCode result = SpssThinWrapper.spssGetDEWNextImpl(handle, ref data, data.Length, out len);
 212			data = (result == ReturnCode.SPSS_OK) ? data.Substring(0, len) : null;
 213			return result;
 214		}
 215		/// <summary>
 216		/// Gets the file label of a data file.
 217		/// </summary>
 218		/// <param name="handle">
 219		/// Handle to the data file.
 220		/// </param>
 221		/// <param name="id">
 222		/// File label.
 223		/// </param>
 224		/// <returns>
 225		/// <see cref="ReturnCode.SPSS_OK"/> or
 226		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>.
 227		/// </returns>
 228		/// <remarks>
 229		/// This function retrieves the file label of the SPSS data file associated with 
 230		/// <paramref>handle</paramref> into the <paramref>id</paramref> parameter.
 231		/// </remarks>
 232		public static ReturnCode spssGetIdString(int handle, out string id)
 233		{
 234			id = new string(' ', SPSS_MAX_IDSTRING + 1); // leave room for null terminator
 235			ReturnCode result = SpssThinWrapper.spssGetIdStringImpl(handle, ref id);
 236			id = (result == ReturnCode.SPSS_OK) ? id.Substring(0, id.IndexOf('\0')) : null;
 237			return result;
 238		}
 239		/// <summary>
 240		/// Gets information on the running version of SPSS, and the hosting computer.
 241		/// </summary>
 242		/// <param name="handle">
 243		/// Handle to the data file.
 244		/// </param>
 245		/// <param name="relInfo">
 246		/// Array of <see cref="int"/> in which release- and machine-specific data will be
 247		/// stored.
 248		/// </param>
 249		/// <returns>
 250		/// <see cref="ReturnCode.SPSS_OK"/>,
 251		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>, or
 252		/// <see cref="ReturnCode.SPSS_NO_TYPE73"/>.
 253		/// </returns>
 254		/// <remarks>
 255		/// This function reports release- and machine-specific information about the file
 256		/// associated with handle. The information consists of an array of eight int values copied
 257		/// from record type 7, subtype 3 of the file, and is useful primarily for debugging. The
 258		/// array elements are, in order, release number (index 0), release subnumber (1), special
 259		/// release identifier number (2), machine code (3), floating-point representation code (4),
 260		/// compression scheme code (5), big/little-endian code (6), and character representation
 261		/// code (7).
 262		/// </remarks>
 263		public static ReturnCode spssGetReleaseInfo(int handle, out int[] relInfo)
 264		{
 265			relInfo = new int[8];
 266			ReturnCode result = SpssThinWrapper.spssGetReleaseInfoImpl(handle, relInfo);
 267			return result;
 268		}
 269		/// <summary>
 270		/// Gets the name of the system that created a data file.
 271		/// </summary>
 272		/// <param name="handle">
 273		/// Handle to the data file.
 274		/// </param>
 275		/// <param name="sysName">
 276		/// The originating system name.
 277		/// </param>
 278		/// <returns>
 279		/// <see cref="ReturnCode.SPSS_OK"/> or
 280		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>.
 281		/// </returns>
 282		/// <remarks>
 283		/// This function returns the name of the system under which the file was created.
 284		/// </remarks>
 285		public static ReturnCode spssGetSystemString(int handle, out string sysName)
 286		{
 287			sysName = new string(' ', SPSS_SYSTEM_STRING_LENGTH + 1); // leave room for null terminator
 288			ReturnCode result = SpssThinWrapper.spssGetSystemStringImpl(handle, ref sysName);
 289			sysName = (result == ReturnCode.SPSS_OK) ? sysName.Substring(0, sysName.IndexOf('\0')) : null;
 290			return result;
 291		}
 292		/// <summary>
 293		/// Gets the data created by TextSmart.
 294		/// </summary>
 295		/// <param name="handle">
 296		/// Handle to the data file.
 297		/// </param>
 298		/// <param name="textInfo">
 299		/// Text data.
 300		/// </param>
 301		/// <returns>
 302		/// <see cref="ReturnCode.SPSS_OK"/> or
 303		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>.
 304		/// </returns>
 305		/// <remarks>
 306		/// This function retrieves the text data created by TextSmart.
 307		/// </remarks>
 308		public static ReturnCode spssGetTextInfo(int handle, out string textInfo)
 309		{
 310			textInfo = new string(' ', SPSS_MAX_TEXTINFO + 1);
 311			ReturnCode result = SpssThinWrapper.spssGetTextInfoImpl(handle, ref textInfo);
 312			textInfo = (result == ReturnCode.SPSS_OK) ? textInfo.Substring(0, textInfo.IndexOf('\0')) : null;
 313			return result;
 314		}
 315		/// <summary>
 316		/// Gets the creation date of a data file, as recorded in the file itself.
 317		/// </summary>
 318		/// <param name="handle">
 319		/// Handle to the data file.
 320		/// </param>
 321		/// <param name="fileDate">
 322		/// File creation date.
 323		/// </param>
 324		/// <param name="fileTime">
 325		/// File creation time.
 326		/// </param>
 327		/// <returns>
 328		/// <see cref="ReturnCode.SPSS_OK"/> or
 329		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>.
 330		/// </returns>
 331		/// <remarks>
 332		/// This function returns the creation date of the file as recorded in the file itself. The creation
 333		/// date is a 9-byte string in dd mmm yy format (27 Feb 96). The creation time is a 
 334		/// 8-byte oypcbi in hh:mm:ss format (13:12:15).
 335		/// </remarks>
 336		public static ReturnCode spssGetTimeStamp(int handle, out string fileDate, out string fileTime)
 337		{
 338			fileDate = new string(' ', SPSS_DATESTAMP_LENGTH + 1);
 339			fileTime = new string(' ', SPSS_TIMESTAMP_LENGTH + 1);
 340			ReturnCode result = SpssThinWrapper.spssGetTimeStampImpl(handle, ref fileDate, ref fileTime);
 341			fileDate = (result == ReturnCode.SPSS_OK) ? fileDate.Substring(0, fileDate.IndexOf('\0')) : null;
 342			fileTime = (result == ReturnCode.SPSS_OK) ? fileTime.Substring(0, fileTime.IndexOf('\0')) : null;
 343			return result;
 344		}
 345		/// <summary>
 346		/// Gets the string value of a variable.
 347		/// </summary>
 348		/// <param name="handle">
 349		/// Handle to the data file.
 350		/// </param>
 351		/// <param name="varHandle">
 352		/// Handle of the variable.
 353		/// </param>
 354		/// <param name="value">
 355		/// Value of the string variable.
 356		/// </param>
 357		/// <returns>
 358		/// <see cref="ReturnCode.SPSS_OK"/>,
 359		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 360		/// <see cref="ReturnCode.SPSS_OPEN_WRMODE"/>,
 361		/// <see cref="ReturnCode.SPSS_INVALID_CASE"/>,
 362		/// <see cref="ReturnCode.SPSS_STR_EXP"/>, or
 363		/// <see cref="ReturnCode.SPSS_BUFFER_SHORT"/>.
 364		/// </returns>
 365		/// <remarks>
 366		/// This function gets the value of a string variable for the current case, which is the case
 367		/// read by the most recent call to <see cref="SpssThinWrapper.spssReadCaseRecordDelegate"/>. 
 368		/// </remarks>
 369		public static ReturnCode spssGetValueChar(int handle, double varHandle, out string value)
 370		{
 371			value = new string(' ', SPSS_MAX_LONGSTRING + 1); // leave room for null terminator
 372			ReturnCode result = SpssThinWrapper.spssGetValueCharImpl(handle, varHandle, ref value, value.Length);
 373			if (result == ReturnCode.SPSS_BUFFER_SHORT)
 374			{
 375				value = new string(' ', SPSS_MAX_VERYLONGSTRING + 1);
 376				result = SpssThinWrapper.spssGetValueCharImpl(handle, varHandle, ref value, value.Length);
 377			}
 378
 379			value = (result == ReturnCode.SPSS_OK) ? value.Substring(0, value.IndexOf('\0')) : null;
 380			return result;
 381		}
 382
 383		/// <summary>
 384		/// Gets the alignment of a variable.
 385		/// </summary>
 386		/// <param name="handle">
 387		/// Handle to the data file.
 388		/// </param>
 389		/// <param name="varName">
 390		/// Variable name.
 391		/// </param>
 392		/// <param name="alignment">
 393		/// Alignment of the variable.
 394		/// </param>
 395		/// <returns>
 396		/// <see cref="ReturnCode.SPSS_OK"/>,
 397		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 398		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 399		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 400		/// </returns>
 401		/// <remarks>
 402		/// This function reports the value of the alignment attribute of a variable.
 403		/// </remarks>
 404		public static ReturnCode spssGetVarAlignment(int handle, string varName, out AlignmentCode alignment)
 405		{
 406			return SpssThinWrapper.spssGetVarAlignmentImpl(handle, ref varName, out alignment);
 407		}
 408		/// <summary>
 409		/// Gets the missing values of a short string variable.
 410		/// </summary>
 411		/// <param name="handle">
 412		/// Handle to the data file.
 413		/// </param>
 414		/// <param name="varName">
 415		/// Variable name.
 416		/// </param>
 417		/// <param name="missingFormat">
 418		/// Missing value format code.
 419		/// </param>
 420		/// <param name="missingVal1">
 421		/// First missing value.
 422		/// </param>
 423		/// <param name="missingVal2">
 424		/// Second missing value.
 425		/// </param>
 426		/// <param name="missingVal3">
 427		/// Third missing value.
 428		/// </param>
 429		/// <returns>
 430		/// <see cref="ReturnCode.SPSS_OK"/>,
 431		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 432		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, 
 433		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>,
 434		/// <see cref="ReturnCode.SPSS_STR_EXP"/>, or
 435		/// <see cref="ReturnCode.SPSS_SHORTSTR_EXP"/>.
 436		/// </returns>
 437		/// <remarks>
 438		/// This function reports the missing values of a short string variable. The value of
 439		/// <paramref>missingFormat</paramref> will indicate 
 440		/// the number of missing values. The
 441		/// appropriate number of missing values is copied to the <paramref>missingVal1</paramref>,
 442		/// <paramref>missingVal2</paramref>, and <paramref>missingVal3</paramref> parameters. 
 443		/// </remarks>
 444		public static ReturnCode spssGetVarCMissingValues(int handle, string varName, out MissingValueFormatCode missingFormat, out string missingVal1, out string missingVal2, out string missingVal3)
 445		{
 446			missingVal1 = new string(' ', SPSS_MAX_SHORTSTRING + 1);
 447			missingVal2 = new string(' ', SPSS_MAX_SHORTSTRING + 1);
 448			missingVal3 = new string(' ', SPSS_MAX_SHORTSTRING + 1);
 449			ReturnCode result = SpssThinWrapper.spssGetVarCMissingValuesImpl(handle, ref varName, out missingFormat,
 450				ref missingVal1, ref missingVal2, ref missingVal3);
 451			if (missingFormat < MissingValueFormatCode.SPSS_THREE_MISSVAL)
 452				missingVal3 = null;
 453			else
 454				missingVal3 = (result == ReturnCode.SPSS_OK) ? missingVal3.Substring(0, missingVal3.IndexOf('\0')) : null;
 455			if (missingFormat < MissingValueFormatCode.SPSS_TWO_MISSVAL)
 456				missingVal2 = null;
 457			else
 458				missingVal2 = (result == ReturnCode.SPSS_OK) ? missingVal2.Substring(0, missingVal2.IndexOf('\0')) : null;
 459			if (missingFormat < MissingValueFormatCode.SPSS_ONE_MISSVAL)
 460				missingVal1 = null;
 461			else
 462				missingVal1 = (result == ReturnCode.SPSS_OK) ? missingVal1.Substring(0, missingVal1.IndexOf('\0')) : null;
 463			return result;
 464		}
 465		/// <summary>
 466		/// Gets the width of a variable.
 467		/// </summary>
 468		/// <param name="handle">
 469		/// Handle to the data file.
 470		/// </param>
 471		/// <param name="varName">
 472		/// Variable name.
 473		/// </param>
 474		/// <param name="columnWidth">
 475		/// Column width.
 476		/// </param>
 477		/// <returns>
 478		/// <see cref="ReturnCode.SPSS_OK"/>,
 479		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 480		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 481		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 482		/// </returns>
 483		/// <remarks>
 484		/// This function reports the value of the column width attribute of a variable. A value of
 485		/// zero is special and means that the SPSS Data Editor, which is the primary user of this
 486		/// attribute, will set an appropriate width using its own algorithm.
 487		/// </remarks>
 488		public static ReturnCode spssGetVarColumnWidth(int handle, string varName, out int columnWidth)
 489		{
 490			return SpssThinWrapper.spssGetVarColumnWidthImpl(handle, ref varName, out columnWidth);
 491		}
 492		/// <summary>
 493		/// Gets the name and type of a variable.
 494		/// </summary>
 495		/// <param name="handle">
 496		/// Handle to the data file.
 497		/// </param>
 498		/// <param name="iVar">
 499		/// Zero origin variable number.
 500		/// </param>
 501		/// <param name="varName">
 502		/// Variable name.
 503		/// </param>
 504		/// <param name="varType">
 505		/// Variable type.
 506		/// </param>
 507		/// <returns>
 508		/// <see cref="ReturnCode.SPSS_OK"/>,
 509		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 510		/// <see cref="ReturnCode.SPSS_INVALID_FILE"/>,
 511		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>, or
 512		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 513		/// </returns>
 514		/// <remarks>
 515		/// This function gets the name and type of one of the variables present in a data file. It
 516		/// serves the same purpose as <see cref="spssGetVarNames"/> but returns the information one variable
 517		/// at a time and, therefore, can be passed to a Visual Basic program. 
 518		/// The type code is an integer in the range 0–255, 0 indicating a numeric
 519		/// variable and a positive value indicating a string variable of that size.
 520		/// </remarks>
 521		public static ReturnCode spssGetVarInfo(int handle, int iVar, out string varName, out int varType)
 522		{
 523			varName = new string(' ', SpssSafeWrapper.SPSS_MAX_VARNAME + 1);
 524			ReturnCode result = SpssThinWrapper.spssGetVarInfoImpl(handle, iVar, ref varName, out varType);
 525			varName = (result == ReturnCode.SPSS_OK) ? varName.Substring(0, varName.IndexOf('\0')) : null;
 526			return result;
 527		}
 528		/// <summary>
 529		/// Gets the handle for a named variable.
 530		/// </summary>
 531		/// <param name="handle">
 532		/// Handle to the data file.
 533		/// </param>
 534		/// <param name="varName">
 535		/// Variable name.
 536		/// </param>
 537		/// <param name="varHandle">
 538		/// Handle for the variable.
 539		/// </param>
 540		/// <returns>
 541		/// <see cref="ReturnCode.SPSS_OK"/>,
 542		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 543		/// <see cref="ReturnCode.SPSS_DICT_NOTCOMMIT"/>,
 544		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>,
 545		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>, or
 546		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
 547		/// </returns>
 548		/// <remarks>
 549		/// This function returns a handle for a variable, which can then be used to read or write
 550		/// (depending on how the file was opened) values of the variable. If handle is associated
 551		/// with an output file, the dictionary must be written with <see cref="SpssThinWrapper.spssCommitHeaderDelegate"/> 
 552		/// before variable handles can be obtained via spssGetVarHandle.
 553		/// </remarks>
 554		public static ReturnCode spssGetVarHandle(int handle, string varName, out double varHandle)
 555		{
 556			return SpssThinWrapper.spssGetVarHandleImpl(handle, ref varName, out varHandle);
 557		}
 558		/// <summary>
 559		/// Gets the variable label for some named variable.
 560		/// </summary>
 561		/// <param name="handle">
 562		/// Handle to the data file.
 563		/// </param>
 564		/// <param name="varName">
 565		/// Variable name.
 566		/// </param>
 567		/// <param name="varLabel">
 568		/// Variable label.
 569		/// </param>
 570		/// <returns>
 571		/// <see cref="ReturnCode.SPSS_OK"/>,
 572		/// <see cref="ReturnCode.SPSS_NO_LABEL"/>, 
 573		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 574		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 575		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 576		/// </returns>
 577		/// <remarks>
 578		/// This function copies the label of variable <paramref>varName</paramref> into 
 579		/// <paramref>varLabel</paramref>.  To get labels more than 120 characters long, use
 580		/// the spssGetVarLabelLong function.
 581		/// </remarks>
 582		public static ReturnCode spssGetVarLabel(int handle, string varName, out string varLabel)
 583		{
 584			int len;
 585			varLabel = new string(' ', SPSS_MAX_LONGSTRING + 1); // leave room for null terminator
 586			ReturnCode result = spssGetVarLabelLongImpl(handle, ref varName, ref varLabel, varLabel.Length, out len);
 587			varLabel = (result == ReturnCode.SPSS_OK) ? varLabel.Substring(0, len) : varLabel = null;
 588			return result;
 589		}
 590
 591		/// <summary>
 592		/// Gets the measurement level of a variable.
 593		/// </summary>
 594		/// <param name="handle">
 595		/// Handle to the data file.
 596		/// </param>
 597		/// <param name="varName">
 598		/// Variable name.
 599		/// </param>
 600		/// <param name="measureLevel">
 601		/// Measurement level.
 602		/// </param>
 603		/// <returns>
 604		/// <see cref="ReturnCode.SPSS_OK"/>,
 605		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 606		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 607		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 608		/// </returns>
 609		/// <remarks>
 610		/// This function reports the value of the measurement level attribute of a variable.
 611		/// </remarks>
 612		public static ReturnCode spssGetVarMeasureLevel(int handle, string varName, out MeasurementLevelCode measureLevel)
 613		{
 614			int measureLevelInt;
 615			ReturnCode status = SpssThinWrapper.spssGetVarMeasureLevelImpl(handle, ref varName, out measureLevelInt);
 616			measureLevel = (MeasurementLevelCode)measureLevelInt;
 617			return status;
 618		}
 619		/// <summary>
 620		/// Gets the missing values of a numeric variable.
 621		/// </summary>
 622		/// <param name="handle">
 623		/// Handle to the data file.
 624		/// </param>
 625		/// <param name="varName">
 626		/// Variable name.
 627		/// </param>
 628		/// <param name="missingFormat">
 629		/// Missing value format code.
 630		/// </param>
 631		/// <param name="missingVal1">
 632		/// First missing value.
 633		/// </param>
 634		/// <param name="missingVal2">
 635		/// Second missing value.
 636		/// </param>
 637		/// <param name="missingVal3">
 638		/// Third missing value.
 639		/// </param>
 640		/// <returns>
 641		/// <see cref="ReturnCode.SPSS_OK"/>,
 642		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 643		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, 
 644		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>, or
 645		/// <see cref="ReturnCode.SPSS_NUME_EXP"/>.
 646		/// </returns>
 647		/// <remarks>
 648		/// This function reports the missing values of a numeric variable. The value of
 649		/// <paramref>missingFormat</paramref> determines the interpretation of 
 650		/// <paramref>missingVal1</paramref>, <paramref>missingVal2</paramref>, and
 651		/// <paramref>missingVal3</paramref>. If missingFormat is SPSS_MISS_RANGE, 
 652		/// <paramref>missingVal1</paramref> and <paramref>missingVal2</paramref>
 653		/// represent the upper and lower limits, respectively, of the range, and 
 654		/// <paramref>missingVal3</paramref> is not used. If missingFormat is 
 655		/// SPSS_MISS_RANGEANDVAL, <paramref>missingVal1</paramref> and 
 656		/// <paramref>missingVal2</paramref> represent the range and 
 657		/// <paramref>missingVal3</paramref> is the discrete missing value. 
 658		/// If missingFormat is neither of the above, it will be in the range 
 659		/// 0–3, indicating the number of discrete missing
 660		/// values present. (The macros SPSS_NO_MISSVAL, SPSS_ONE_MISSVAL,
 661		/// SPSS_TWO_MISSVAL, and SPSS_THREE_MISSVAL may be used as synonyms for 0–3.)
 662		/// </remarks>
 663		public static ReturnCode spssGetVarNMissingValues(int handle, string varName, out MissingValueFormatCode missingFormat, out double missingVal1, out double missingVal2, out double missingVal3)
 664		{
 665			return SpssThinWrapper.spssGetVarNMissingValuesImpl(handle, ref varName, out missingFormat, out missingVal1, out missingVal2, out missingVal3);
 666		}
 667		/// <summary>
 668		/// Gets the value label for a variable.
 669		/// </summary>
 670		/// <param name="handle">
 671		/// Handle to the data file.
 672		/// </param>
 673		/// <param name="varName">
 674		/// Variable name.
 675		/// </param>
 676		/// <param name="value">
 677		/// Short string value for which the label is wanted.
 678		/// </param>
 679		/// <param name="label">
 680		/// Label for the value.
 681		/// </param>
 682		/// <returns>
 683		/// <see cref="ReturnCode.SPSS_OK"/>,
 684		/// <see cref="ReturnCode.SPSS_NO_LABELS"/>,
 685		/// <see cref="ReturnCode.SPSS_NO_LABEL"/>,
 686		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 687		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>,
 688		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>,
 689		/// <see cref="ReturnCode.SPSS_STR_EXP"/>,
 690		/// <see cref="ReturnCode.SPSS_SHORTSTR_EXP"/>, or
 691		/// <see cref="ReturnCode.SPSS_EXC_STRVALUE"/>.
 692		/// </returns>
 693		/// <remarks>
 694		/// This function gets the value label for a given value of a short string variable. 
 695		/// </remarks>
 696		public static ReturnCode spssGetVarCValueLabel(int handle, string varName, string value, out string label)
 697		{
 698			int len;
 699			label = new string(' ', SPSS_MAX_VALLABEL + 1);
 700			ReturnCode result = spssGetVarCValueLabelLongImpl(handle, ref varName, ref value, ref label, label.Length, out len);
 701			label = (result == ReturnCode.SPSS_OK) ? label.Substring(0, len) : null;
 702			return result;
 703		}
 704		/// <summary>
 705		/// Gets the value label for a given value of a numeric variable.
 706		/// </summary>
 707		/// <param name="handle">
 708		/// Handle to the data file.
 709		/// </param>
 710		/// <param name="varName">
 711		/// Variable name.
 712		/// </param>
 713		/// <param name="value">
 714		/// Numeric value for which the label is wanted.
 715		/// </param>
 716		/// <param name="label">
 717		/// Label for the value.
 718		/// </param>
 719		/// <returns>
 720		/// <see cref="ReturnCode.SPSS_OK"/>,
 721		/// <see cref="ReturnCode.SPSS_NO_LABELS"/>,
 722		/// <see cref="ReturnCode.SPSS_NO_LABEL"/>, 
 723		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 724		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, 
 725		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>, or
 726		/// <see cref="ReturnCode.SPSS_NUME_EXP"/>.
 727		/// </returns>
 728		/// <remarks>
 729		/// This function gets the value label for a given value of a numeric variable. 
 730		/// </remarks>
 731		public static ReturnCode spssGetVarNValueLabel(int handle, string varName, double value, out string label)
 732		{
 733			int len;
 734			label = new string(' ', SPSS_MAX_VALLABEL + 1); // leave room for null terminator
 735			ReturnCode result = spssGetVarNValueLabelLong(handle, ref varName, value, ref label, label.Length, out len);
 736			if (result == ReturnCode.SPSS_OK)
 737				label = label.Substring(0, len);
 738			else
 739				label = null;
 740
 741			return result;
 742		}
 743
 744		/// <summary>
 745		/// Gets print formatting information for a variable.
 746		/// </summary>
 747		/// <param name="handle">
 748		/// Handle to the data file.
 749		/// </param>
 750		/// <param name="varName">
 751		/// Variable name.
 752		/// </param>
 753		/// <param name="printType">
 754		/// Print format type code (file spssdio.h defines macros of
 755		/// the form <see cref="FormatTypeCode">SPSS_FMT_...</see> for all valid format type codes)
 756		/// </param>
 757		/// <param name="printDec">
 758		/// Number of digits after the decimal.
 759		/// </param>
 760		/// <param name="printWidth">
 761		/// Print format width.
 762		/// </param>
 763		/// <returns>
 764		/// <see cref="ReturnCode.SPSS_OK"/>,
 765		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 766		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 767		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 768		/// </returns>
 769		/// <remarks>
 770		/// This function reports the print format of a variable. Format type, number of decimal
 771		/// places, and field width are returned as <paramref>printType</paramref>, 
 772		/// <paramref>printDec</paramref>, and <paramref>printWid</paramref>, respectively.
 773		/// </remarks>
 774		public static ReturnCode spssGetVarPrintFormat(int handle, string varName, out FormatTypeCode printType, out int printDec, out int printWidth)
 775		{
 776			return SpssThinWrapper.spssGetVarPrintFormatImpl(handle, ref varName, out printType, out printDec, out printWidth);
 777		}
 778		/// <summary>
 779		/// Gets the write format of a variable.
 780		/// </summary>
 781		/// <param name="handle">
 782		/// Handle to the data file
 783		/// </param>
 784		/// <param name="varName">
 785		/// Variable name
 786		/// </param>
 787		/// <param name="writeType">
 788		/// Pointer to write format type code (file spssdio.h defines macros of
 789		/// the form <see cref="FormatTypeCode">SPSS_FMT_...</see> for all valid format type codes)
 790		/// </param>
 791		/// <param name="writeDec">
 792		/// Pointer to number of digits after the decimal
 793		/// </param>
 794		/// <param name="writeWidth">
 795		/// Pointer to write format width
 796		/// </param>
 797		/// <returns>
 798		/// <see cref="ReturnCode.SPSS_OK"/>,
 799		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 800		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
 801		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
 802		/// </returns>
 803		/// <remarks>
 804		/// This function reports the write format of a variable. Format type, number of decimal
 805		/// places, and field width are returned as writeType, writeDec, and writeWid,
 806		/// respectively.
 807		/// </remarks>
 808		public static ReturnCode spssGetVarWriteFormat(int handle, string varName, out FormatTypeCode writeType, out int writeDec, out int writeWidth)
 809		{
 810			return SpssThinWrapper.spssGetVarWriteFormatImpl(handle, ref varName, out writeType, out writeDec, out writeWidth);
 811		}
 812		/// <summary>
 813		/// Opens an SPSS file for appending cases.
 814		/// </summary>
 815		/// <param name="fileName">
 816		/// Name of the file.
 817		/// </param>
 818		/// <param name="handle">
 819		/// Handle to the opened file.
 820		/// </param>
 821		/// <returns>
 822		/// <see cref="ReturnCode.SPSS_OK"/>,
 823		/// <see cref="ReturnCode.SPSS_FITAB_FULL"/>,
 824		/// <see cref="ReturnCode.SPSS_FILE_OERROR"/>,
 825		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>,
 826		/// <see cref="ReturnCode.SPSS_FILE_RERROR"/>,
 827		/// <see cref="ReturnCode.SPSS_INVALID_FILE"/>,
 828		/// <see cref="ReturnCode.SPSS_NO_TYPE2"/>,
 829		/// <see cref="ReturnCode.SPSS_NO_TYPE999"/>, or
 830		/// <see cref="ReturnCode.SPSS_INCOMPAT_APPEND"/>.
 831		/// </returns>
 832		/// <remarks>
 833		/// This function opens an SPSS data file for appending cases and returns a handle that
 834		/// should be used for subsequent operations on the file.
 835		/// </remarks>
 836		public static ReturnCode spssOpenAppend(string fileName, out int handle)
 837		{
 838			return SpssThinWrapper.spssOpenAppendImpl(ref fileName, out handle);
 839		}
 840		/// <summary>
 841		/// Creates a new SPSS data file, with a dictionary copied from an existing file.
 842		/// </summary>
 843		/// <param name="fileName">
 844		/// Name of the new file.
 845		/// </param>
 846		/// <param name="dictFileName">
 847		/// Name of existing file.
 848		/// </param>
 849		/// <param name="handle">
 850		/// Handle of the new file.
 851		/// </param>
 852		/// <returns>
 853		/// <see cref="ReturnCode.SPSS_OK"/>,
 854		/// <see cref="ReturnCode.SPSS_FITAB_FULL"/>,
 855		/// <see cref="ReturnCode.SPSS_FILE_OERROR"/>,
 856		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>,
 857		/// <see cref="ReturnCode.SPSS_FILE_RERROR"/>,
 858		/// <see cref="ReturnCode.SPSS_INVALID_FILE"/>,
 859		/// <see cref="ReturnCode.SPSS_NO_TYPE2"/>, or
 860		/// <see cref="ReturnCode.SPSS_NO_TYPE999"/>.
 861		/// </returns>
 862		/// <remarks>
 863		/// This function opens a file in preparation for creating a new SPSS data file and initializes
 864		/// its dictionary from that of an existing SPSS data file. It is useful when you want to modify
 865		/// the dictionary or data of an existing file or replace all of its data. The typical sequence
 866		/// of operations is to call <see cref="spssOpenWriteCopy"/> (newFileName, oldFileName, ...) to open a
 867		/// new file initialized with a copy of the old file’s dictionary, then <see cref="spssOpenRead"/> (oldFile-
 868		/// Name, ...) to open the old file to access its data.
 869		/// </remarks>
 870		public static ReturnCode spssOpenWriteCopy(string fileName, string dictFileName, out int handle)
 871		{
 872			return SpssThinWrapper.spssOpenWriteCopyImpl(ref fileName, ref dictFileName, out handle);
 873		}
 874		/// <summary>
 875		/// Sets the case weight variable in a data file.
 876		/// </summary>
 877		/// <param name="handle">
 878		/// Handle to the data file.
 879		/// </param>
 880		/// <param name="varName">
 881		/// The name of the case weight variable.
 882		/// </param>
 883		/// <returns>
 884		/// <see cref="ReturnCode.SPSS_OK"/>,
 885		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 886		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
 887		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
 888		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>,
 889		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>,
 890		/// <see cref="ReturnCode.SPSS_NUME_EXP"/>, or
 891		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
 892		/// </returns>
 893		/// <remarks>
 894		/// This function defines variable varName as the case weight variable for the data file
 895		/// specified by the handle.
 896		/// </remarks>
 897		public static ReturnCode spssSetCaseWeightVar(int handle, string varName)
 898		{
 899			return SpssThinWrapper.spssSetCaseWeightVarImpl(handle, ref varName);
 900		}
 901		/// <summary>
 902		/// Sets the Trends date variable information.
 903		/// </summary>
 904		/// <param name="handle">
 905		/// Handle to the data file.
 906		/// </param>
 907		/// <param name="dateInfo">
 908		/// Array containing date variables information.
 909		/// </param>
 910		/// <returns>
 911		/// <see cref="ReturnCode.SPSS_OK"/>,
 912		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 913		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
 914		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
 915		/// <see cref="ReturnCode.SPSS_INVALID_DATEINFO"/>, or
 916		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
 917		/// </returns>
 918		/// <remarks>
 919		/// This function sets the Trends date variable information. The array at dateInfo is
 920		/// assumed to have numofElements elements that correspond to the data array portion of
 921		/// record 7, subtype 3. Its first six elements comprise the “fixed” information, followed
 922		/// by a sequence of one or more three-element groups. Since very little validity checking
 923		/// is done on the input array, this function should be used with caution and is
 924		/// recommended only for copying Trends information from one file to another.
 925		/// </remarks>
 926		unsafe public static ReturnCode spssSetDateVariables(int handle, int[] dateInfo)
 927		{
 928			return SpssThinWrapper.spssSetDateVariablesImpl(handle, dateInfo.Length, (int*)Marshal.UnsafeAddrOfPinnedArrayElement(dateInfo, 0));
 929		}
 930		/// <summary>
 931		/// Sets the first block of Data Entry information.
 932		/// </summary>
 933		/// <param name="handle">
 934		/// Handle to the data file.
 935		/// </param>
 936		/// <param name="data">
 937		/// Data to be written.
 938		/// </param>
 939		/// <returns>
 940		/// <see cref="ReturnCode.SPSS_OK"/>,
 941		/// <see cref="ReturnCode.SPSS_EMPTY_DEW"/>,
 942		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 943		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
 944		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
 945		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>, or
 946		/// <see cref="ReturnCode.SPSS_FILE_BADTEMP"/>.
 947		/// </returns>
 948		/// <remarks>
 949		/// DEW information (file information which is private to the SPSS Data Entry product)
 950		/// can be delivered to the I/O DLL in whatever segments are convenient for the client.
 951		/// The spssSetDEWFirst function is called to deliver the first such segment, and
 952		/// subsequent segments are delivered by calling spssSetDEWNext as many times as
 953		/// necessary.
 954		/// </remarks>
 955		public static ReturnCode spssSetDEWFirst(int handle, string data)
 956		{
 957			return SpssThinWrapper.spssSetDEWFirstImpl(handle, ref data, data.Length);
 958		}
 959		/// <summary>
 960		/// Sets the unique Data Entry uniqueness GUID.
 961		/// </summary>
 962		/// <param name="handle">
 963		/// Handle to the data file.
 964		/// </param>
 965		/// <param name="asciiGUID">
 966		/// The GUID to be stored on the file.
 967		/// </param>
 968		/// <returns>
 969		/// <see cref="ReturnCode.SPSS_OK"/>,
 970		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 971		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
 972		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>, or
 973		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
 974		/// </returns>
 975		/// <remarks>
 976		/// This function stores the Data Entry for Windows uniqueness indicator on the data file.
 977		/// It should only be used by the DEW product.
 978		/// </remarks>
 979		public static ReturnCode spssSetDEWGUID(int handle, string asciiGUID)
 980		{
 981			return SpssThinWrapper.spssSetDEWGUIDImpl(handle, ref asciiGUID);
 982		}
 983		/// <summary>
 984		/// Sets the next block of information for Data Entry.
 985		/// </summary>
 986		/// <param name="handle">
 987		/// Handle to the data file.
 988		/// </param>
 989		/// <param name="data">
 990		/// Data to be written.
 991		/// </param>
 992		/// <returns>
 993		/// <see cref="ReturnCode.SPSS_OK"/>,
 994		/// <see cref="ReturnCode.SPSS_DEW_NOFIRST"/>,
 995		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
 996		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
 997		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
 998		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>, or
 999		/// <see cref="ReturnCode.SPSS_FILE_BADTEMP"/>.
1000		/// </returns>
1001		/// <remarks>
1002		/// The DEW information (file information that is private to the SPSS Data Entry product)
1003		/// can be delivered to the I/O DLL in whatever segments are convenient for the client.
1004		/// The spssSetDEWFirst function is called to deliver the first such segment, and
1005		/// subsequent segments are delivered by calling spssSetDEWNext as many times as
1006		/// necessary.
1007		/// </remarks>
1008		public static ReturnCode spssSetDEWNext(int handle, string data)
1009		{
1010			return SpssThinWrapper.spssSetDEWNextImpl(handle, ref data, data.Length);
1011		}
1012		/// <summary>
1013		/// Sets the file label of a data file.
1014		/// </summary>
1015		/// <param name="handle">
1016		/// Handle to the data file.
1017		/// </param>
1018		/// <param name="id">
1019		/// File label. The length of the string should not exceed 
1020		/// <see cref="SpssThinWrapper.SPSS_MAX_IDSTRING"/> characters.
1021		/// </param>
1022		/// <returns>
1023		/// <see cref="ReturnCode.SPSS_OK"/>,
1024		/// <see cref="ReturnCode.SPSS_EXC_LEN64"/>
1025		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1026		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>, or
1027		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>.
1028		/// </returns>
1029		/// <remarks>
1030		/// This function sets the file label of the output SPSS data file associated with handle to
1031		/// the given string id.
1032		/// </remarks>
1033		public static ReturnCode spssSetIdString(int handle, string id)
1034		{
1035			return SpssThinWrapper.spssSetIdStringImpl(handle, ref id);
1036		}
1037
1038		/// <summary>
1039		/// Sets multiple response definitions to a data file.
1040		/// </summary>
1041		/// <param name="handle">
1042		/// Handle to the data file.
1043		/// </param>
1044		/// <param name="mrespDefs">
1045		/// ASCII string containing definitions.
1046		/// </param>
1047		/// <returns>
1048		/// <see cref="ReturnCode.SPSS_OK"/>,
1049		/// <see cref="ReturnCode.SPSS_EMPTY_MULTRESP"/>
1050		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1051		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1052		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>, or
1053		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
1054		/// </returns>
1055		/// <remarks>
1056		/// This function is used to write multiple response definitions to the file. The definitions
1057		/// consist of a single null-terminated ASCII string which is similar to that containing the
1058		/// variable set definitions.
1059		/// </remarks>
1060		public static ReturnCode spssSetMultRespDefs(int handle, string mrespDefs)
1061		{
1062			return SpssThinWrapper.spssSetMultRespDefsImpl(handle, ref mrespDefs);
1063		}
1064
1065		/// <summary>
1066		/// Sets the text data from the string in textInfo.
1067		/// </summary>
1068		/// <param name="handle">
1069		/// Handle to the data file
1070		/// </param>
1071		/// <param name="textInfo">
1072		/// Text data
1073		/// </param>
1074		/// <returns>
1075		/// <see cref="ReturnCode.SPSS_OK"/>,
1076		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1077		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1078		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>, or
1079		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
1080		/// </returns>
1081		/// <remarks>
1082		/// This function sets the text data from the null-terminated string in textInfo. If the string is
1083		/// longer than 255 characters, only the first 255 are (quietly) used. If textInfo contains the
1084		/// empty string, existing text data, if any, is deleted.
1085		/// </remarks>
1086		public static ReturnCode spssSetTextInfo(int handle, string textInfo)
1087		{
1088			return SpssThinWrapper.spssSetTextInfoImpl(handle, ref textInfo);
1089		}
1090
1091		/// <summary>
1092		/// Sets the value of a string variable.
1093		/// </summary>
1094		/// <param name="handle">
1095		/// Handle to the data file.
1096		/// </param>
1097		/// <param name="varHandle">
1098		/// Handle to the variable.
1099		/// </param>
1100		/// <param name="value">
1101		/// Value of the variable. The length of the
1102		/// string (ignoring trailing blanks, if any) should be less than or equal
1103		/// to the length of the variable.
1104		/// </param>
1105		/// <returns>
1106		/// <see cref="ReturnCode.SPSS_OK"/>,
1107		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1108		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1109		/// <see cref="ReturnCode.SPSS_DICT_NOTCOMMIT"/>,
1110		/// <see cref="ReturnCode.SPSS_STR_EXP"/>, or
1111		/// <see cref="ReturnCode.SPSS_EXC_STRVALUE"/>.
1112		/// </returns>
1113		/// <remarks>
1114		/// This function sets the value of a string variable for the current case. The current case is
1115		/// not written out to the data file until <see cref="SpssThinWrapper.spssCommitCaseRecordDelegate"/> is called.
1116		/// </remarks>
1117		public static ReturnCode spssSetValueChar(int handle, double varHandle, string value)
1118		{
1119			return SpssThinWrapper.spssSetValueCharImpl(handle, varHandle, ref value);
1120		}
1121		/// <summary>
1122		/// Sets the alignment of a variable.
1123		/// </summary>
1124		/// <param name="handle">
1125		/// Handle to the data file.
1126		/// </param>
1127		/// <param name="varName">
1128		/// Variable name.
1129		/// </param>
1130		/// <param name="alignment">
1131		/// Alignment.  If not a legal
1132		/// value, alignment is set to a type-appropriate default.
1133		/// </param>
1134		/// <returns>
1135		/// <see cref="ReturnCode.SPSS_OK"/>,
1136		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1137		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1138		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
1139		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
1140		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
1141		/// </returns>
1142		/// <remarks>
1143		/// This function sets the value of the alignment attribute of a variable.
1144		/// </remarks>
1145		public static ReturnCode spssSetVarAlignment(int handle, string varName, AlignmentCode alignment)
1146		{
1147			return SpssThinWrapper.spssSetVarAlignmentImpl(handle, ref varName, alignment);
1148		}
1149		/// <summary>
1150		/// Sets missing values for a short string variable.
1151		/// </summary>
1152		/// <param name="handle">
1153		/// Handle to the data file.
1154		/// </param>
1155		/// <param name="varName">
1156		/// Variable name.
1157		/// </param>
1158		/// <param name="missingFormat">
1159		/// The number of missing values (0-3) actually supplied.
1160		/// </param>
1161		/// <param name="missingVal1">
1162		/// First missing value.
1163		/// </param>
1164		/// <param name="missingVal2">
1165		/// Second missing value.
1166		/// </param>
1167		/// <param name="missingVal3">
1168		/// Third missing value.
1169		/// </param>
1170		/// <returns>
1171		/// <see cref="ReturnCode.SPSS_OK"/>,
1172		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1173		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1174		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
1175		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>,
1176		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>,
1177		/// <see cref="ReturnCode.SPSS_STR_EXP"/>,
1178		/// <see cref="ReturnCode.SPSS_SHORTSTR_EXP"/>,
1179		/// <see cref="ReturnCode.SPSS_INVALID_MISSFOR"/>,
1180		/// <see cref="ReturnCode.SPSS_EXC_STRVALUE"/>, or
1181		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
1182		/// </returns>
1183		/// <remarks>
1184		/// This function sets missing values for a short string variable. The argument
1185		/// missingFormat must be set to a value in the range 0–3 to indicate the number of missing
1186		/// values supplied. When fewer than three missing values are to be defined, the redundant
1187		/// arguments must still be present, although their values are not inspected. For example,
1188		/// if missingFormat is 2, missingVal3 is unused. The supplied missing values must be nullterminated
1189		/// and not longer than the length of the variable unless the excess length is
1190		/// made up of blanks, which are ignored. If the missing value is shorter than the length of
1191		/// the variable, trailing blanks are assumed.
1192		/// </remarks>
1193		public static ReturnCode spssSetVarCMissingValues(int handle, string varName, MissingValueFormatCode missingFormat, string missingVal1, string missingVal2, string missingVal3)
1194		{
1195			return SpssThinWrapper.spssSetVarCMissingValuesImpl(handle, ref varName, missingFormat,
1196				ref missingVal1, ref missingVal2, ref missingVal3);
1197		}
1198		/// <summary>
1199		/// Sets the column width of a variable.
1200		/// </summary>
1201		/// <param name="handle">
1202		/// Handle to the data file.
1203		/// </param>
1204		/// <param name="varName">
1205		/// Variable name.
1206		/// </param>
1207		/// <param name="columnWidth">
1208		/// Column width. If negative, a value of zero is (quietly) used instead.
1209		/// </param>
1210		/// <returns>
1211		/// <see cref="ReturnCode.SPSS_OK"/>,
1212		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1213		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1214		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
1215		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>, or
1216		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>.
1217		/// </returns>
1218		/// <remarks>
1219		/// This function sets the value of the column width attribute of a variable. A value of zero
1220		/// is special and means that the SPSS Data Editor, which is the primary user of this
1221		/// attribute, is to set an appropriate width using its own algorithm.
1222		/// </remarks>
1223		public static ReturnCode spssSetVarColumnWidth(int handle, string varName, int columnWidth)
1224		{
1225			return SpssThinWrapper.spssSetVarColumnWidthImpl(handle, ref varName, columnWidth);
1226		}
1227		/// <summary>
1228		/// Sets the label of a variable.
1229		/// </summary>
1230		/// <param name="handle">
1231		/// Handle to the data file.
1232		/// </param>
1233		/// <param name="varName">
1234		/// Variable name.
1235		/// </param>
1236		/// <param name="varLabel">
1237		/// Variable label. The length of the string should not exceed 
1238		/// <see cref="SpssThinWrapper.SPSS_MAX_VARLABEL"/> characters.
1239		/// If varLabel is the empty string, the existing label, if any, is deleted.
1240		/// </param>
1241		/// <returns>
1242		/// <see cref="ReturnCode.SPSS_OK"/>,
1243		/// <see cref="ReturnCode.SPSS_EXC_LEN120"/>,
1244		/// <see cref="ReturnCode.SPSS_INVALID_HANDLE"/>,
1245		/// <see cref="ReturnCode.SPSS_OPEN_RDMODE"/>,
1246		/// <see cref="ReturnCode.SPSS_DICT_COMMIT"/>,
1247		/// <see cref="ReturnCode.SPSS_INVALID_VARNAME"/>,
1248		/// <see cref="ReturnCode.SPSS_VAR_NOTFOUND"/>, or
1249		/// <see cref="ReturnCode.SPSS_NO_MEMORY"/>.
1250		/// </returns>
1251		/// <remarks>
1252		/// This function sets the l…

Large files files are truncated, but you can click here to view the full file