[Quantproject-developers] QuantProject/b1_ADT ExtendedDataTable.cs,1.7,1.8
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2004-12-01 22:47:10
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22059/b1_ADT Modified Files: ExtendedDataTable.cs Log Message: Index: ExtendedDataTable.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/ExtendedDataTable.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExtendedDataTable.cs 28 Aug 2004 16:38:32 -0000 1.7 --- ExtendedDataTable.cs 1 Dec 2004 22:46:59 -0000 1.8 *************** *** 95,99 **** } ! /// <summary> /// Get an array of float corresponding to the ratio between columnA and columnB --- 95,125 ---- } ! /// <summary> ! /// Get an array of float corresponding to a column compatible with the float type in a given data table, ! /// filtered by the given filterExpression ! /// </summary> ! public static float[] GetArrayOfFloatFromColumn(DataTable table, ! string columnName, ! string filterExpression) ! { ! DataRow[] selectedRows = table.Select(filterExpression); ! int numRows = selectedRows.Length; ! float[] arrayOfFloat = new float[numRows]; ! int index = 0; ! try ! { ! for(; index!= numRows; index++) ! { ! arrayOfFloat[index] = (float)selectedRows[index][columnName]; ! } ! ! } ! catch(Exception ex) ! { ! MessageBox.Show(ex.ToString()); ! index = numRows; ! } ! return arrayOfFloat; ! } /// <summary> /// Get an array of float corresponding to the ratio between columnA and columnB |