I've reworked the code and now the problem is in the writeline parameters setup.
Code:
public class hk1Class
public char colorpct;
// create dictionaries
public Dictionary<string, int> colors = new Dictionary<string, int>();
public string color; // name for dictionary
public Dictionary<string, string> geneo = new Dictionary<string, string>();
public string gtype; // name for dictionary
public class ColorGenetics
{
// hooks to other classes
public static hk1Class jw;
public static linkedClass link;
static void Main(string[] args)
{
var jw = new hk1Class();
var link = new linkedClass();
program(); // all other methods are called from within
} // end main
public static void child_calc()
{
if (jw.totalcount == hk1Class.rows)
{ jw.linked = true; }
if (jw.linked == true)
{
linkedClass.linked_parent_setup();
{
Dictionary<string, int> childcolor1 = new Dictionary<string, int>();
Dictionary<string, int> colorscopy = new Dictionary<string, int>(childcolor1);
string[] keys = childcolor1.Keys.ToArray();
int[] values = childcolor1.Values.ToArray();
Dictionary<string, string> childgeneo1 = new Dictionary<string, string>();
Dictionary<string, string> geneocopy = new Dictionary<string, string>(childgeneo1);
string[] keys1 = childgeneo1.Keys.ToArray();
string[] values1 = childgeneo1.Values.ToArray();
}
int z = 0;
this section is giving me problems
Code:
while (z < (jw.totalcount + 1))
{
// calculate color type %
int colorpct1 = ((childcolor1[z, 1] / jw.totalcount) * 100);
jw.colorpct = colorct1;
{
int x;
x = jw.colorpct.Length;
jw.colorpct += "%";
}
Console.WriteLine("{0}, {1}, {2}, {3}",
childcolor1[z, 0],
childgeneo1[z, 0],
childcolor1[z, 1],
jw.colorpct);
} // end while
} // end if
return;
} // end child_calc
I'm running into var not existing in current context and type conversion errors.