SharpTune.RomMod.SRecordReader.GetByte C# (CSharp) Method

GetByte() private static method

Get a single byte from an SRecord row.
private static GetByte ( string record, int &index, int &checksum ) : byte
record string
index int
checksum int
return byte
        private static byte GetByte(string record, ref int index, ref int checksum)
        {
            if (record.Length < index + 1)
            {
                Trace.WriteLine("index out of bounds");
                return 0;
            }

            char c1 = record[index];
            index++;
            char c2 = record[index];
            index++;

            string s = string.Format("{0}{1}", c1, c2);
            byte b = byte.Parse(s, System.Globalization.NumberStyles.HexNumber);
            checksum += b;
            return b;
        }