Initializing help system before first use

XPRBreadarrline Method (StreamReader, Int32, String, Int32[], Int32)

Read a line of an array from a data file.

Namespace:   BCL
Assembly:  xprbdn (in xprbdn.dll) Version: 4.8.14.0
Syntax
C#
VB
public int XPRBreadarrline(
	StreamReader fileStreamIn,
	int maxlen,
	string format,
	out int[] output,
	int numData
)

Parameters

fileStreamIn
Type:  System.IOStreamReader
The open StreamReader to read the data from.
maxlen
Type:  SystemInt32
The maximum length of data to read.
format
Type:  SystemString
The format to read the data in. This is a string made up of the following formats, seperated by any seperating characters. The format must be exact with respect to spacing (if there are 0+ spaces between the entries then a space " " must be included in the format string). See the BCL example programs for examples of this.
  • {g} - A double value.
  • {i} - An integer value.
  • {t} or {T} - A string value.
  • {s} - A string within single quotes.
  • {S} - A string within double quotes.
output
Type:  SystemInt32
The out array, in this case if all requested objects were integers you could use this function, otherwise use the more general function that outputs an object[] object.
numData
Type:  SystemInt32
The number of times to read the format string. For instance if the format string was "{i} , {i} ; {i} , " and the numdata=2 then the resultant format string to be read would be "{i} , {i} ; {i} , {i} , {i} ; {i}" as the method strips everything after the last occurence of "}".

Return Value

Type:  Int32
The integer number of items read, -1 on error.
Examples
XPRBprob prob = new XPRBprob("NewProb"); FileStream file = new FileStream("FileReadInt.txt", FileMode.Open, FileAccess.Read); fileStreamIn = new StreamReader(file); outobjInt = new int[6]; prob.XPRBreadarrline(fileStreamIn, 200, "{i}, ", out outobjInt, 6); fileStreamIn.Close(); file.Close();
See Also