control.Region(n).AnySeries([n]).SetDataFile( sFileName, [sLines2Read], [sFields2Read], [sFieldDelimiter], [nReverse])

PurposeDefines a file which contains the data for any series.
Parameter
sFileName String

Path and name of the file, which contains the data. The file must be a normal text file, where each line is terminated either with a single carriage return (CR) or with a carriage return+line feed (CRLF) and where each line contains either one single data value or multiple data values, separated by the same delimiter. CSV-files (which you can create for example with MS EXCEL) belong to such a species of files.

sLines2Read String

Lines to be read. The first line has index 1. There are several possible cases:

  • Empty string ("") or ("0"): All lines will be read, startinfg with the first line, ending with the last line.
  • "-1": All lines will be read, starting with the last line, ending with the first line.
  • String with a positive number (e.g. "20"): The corresponding number of lines will be read, starting with the first line
  • String with a negative number (e.g. "-10"): The corresponding number of lines will be read, starting with the last line
  • String with two positive numbers, separated by a comma (e.g. "10,50"). Line number [first number] to line number [second number] will be read. This is also valid in reverse order (e.g. "20,10"): in this case line 20 to line 10 will be read.
sFields2Read String

Defines the fields of the lines, which shall be read. Each field must be separated by a certain delimiter. The first field has index 1. There are three possible cases:

  • Empty string ("") or ("0"): All fields of a line will be read.
  • String with one ore more positive number(s), seperated by a comma (e.g. "2,5"): The corresponding field(s) will be read.
  • String with two positive number(s), seperated by a dash (e.g. "2-5"): Field [first number] to field [second number] will be read. This is also valid in reverse order, e.g. "5-2".
sFieldDelimiter String

Defines the delimiter, which separates the fields within a line. If omitted, the list separator, which is found in the system settings for the local user, is assumed. If no entry is found, a comma "," is assumed.

nReverse Long (Boolean)

This parameter is obsolete, just pass FALSE or 0.

Return valueIf successful the number of read data values or, in case of an error, an element of the RMCError enumeration.
Remarks

There are four ways to pass the data values to your series:

  • Property DataArray: pass the whole data as an one-dimensional array of doubles.
  • Property DataString: pass the whole data as a string, in which the single values are delimited by asterisks.
  • Method SetDataValue: pass each data value apart.
  • Function SetDataFile: set the name of a file (and more parameters) which contains the data.
Normally for each chart object exists one data value. If you have for example five bars of type RMC_BARSINGLE you must pass five data values. There are two exceptions:
  • Bars with type RMC_FLOATINGBAR and RMC_FLOATINGBARGROUP expect a data pair for each bar, consisting of a value for the starting point and a second value for the length of the bar. Example: Imagine the data axis has a range from 1 to 10 and you want to draw a floating bar which starts at 2 and ends at 9. In this case you must pass the data pair 2,7 for this bar.
  • HighLow series expect four data values for each object in the order open - high - low - close
ExampleRMChartX1.AddRegion
' Add a Line series to the region:
RMChartX1.Region(1).AddLineSeries
' Read from a file field number 2 of the last 30 lines:
RMChartX1.Region(1).LineSeries(1).SetDataFile = "dow2004.csv","-30","2",";",0

There are several example files, which demonstrate how to use this way of data passing: dj-dax-nasdaq.rmc, dj and nasdaq 2004.rmc, xycorrealtion.rmc, candlesticks.rmc, 2 regions.rmc. Load them into RMCDesigner, get the source and look how they make use of this function.