I can't figure why I'm getting this error.Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace RabbitGenetics { public class JWClass { //housekeeping //Jersey Wooly Color Genetics // create list for sire data public List<int> siregtype = new List<int>(); //create list for dam data public List<int> damgtype = new List<int>(); // set sire & dam array size public const int rows = 128; public const int columns = 7; // create lists for dictionaries public List<int> colorslist = new List<int>(); public List<int> gtypelist = new List<int>(); // create sire & dam data 2D arrays public int[,] siredata = new int[rows, columns]; public int[,] damdata = new int[rows, columns]; //create offspring 1D array public int[] offspring = new int[14]; // create sire & dam 1D arrays public int[] sire = new int[14]; public int[] dam = new int[14]; //create child 4D array // public int[, , ,] child = new int[color_counter, 4]; //Dictionaries public Dictionary<string, int> colors = new Dictionary<string, int> { }; public string color; //name key Dictionary<string, string> geneo = new Dictionary<string, string> { }; public string gtype; // geneotype key // gene groups public int Broken, Agouti, Brown, Colour, Dilute, Ext, Vienna; // Vienna types flags bool vienna = false; bool vm = false; bool vc = false; //color flags bool dilute = false; bool charlie = false; bool broken = false; bool rew = false; // data holders public int sen1, sen2, sa1, sa2, sb1, sb2, sc1, sc2, sd1, sd2, se1, se2, sv1, sv2; public int den1, den2, da1, da2, db1, db2, dc1, dc2, dd1, dd2, de1, de2, dv1, dv2; public char colorpct; //declare counters public int sirecounter = 0; public int damcounter = 0; public int offspringcounter = 0; public int totalcount = 0; public int color_count = 0; // public color_counter = 0; public static bool e_trap; } // end JWClass public class Genetics { // public JWClass jw; static void Main() { var jw = new JWClass(); // obj = new JWClass(); prog(); } // end Main // start program run public static void prog() { //array setup variiables for parsing combinations into the correct fields. jw.Broken = (jw.rows / 2); return; } // end prog } // End Class GenticsClass } // end Namespace RabbitGenetics
I want to access and/or modify vars in class JWClass from class Genetics.
I'm new to C# and OOP programming style.
My background is COBOL using the structured style



LinkBack URL
About LinkBacks


