A
A
Aristarkh Deryapa2017-07-06 16:00:12
Debugging
Aristarkh Deryapa, 2017-07-06 16:00:12

Why doesn't the meaning disappear?

I do code parsing through foreach, but after doing everything I need, it disappears. Those. after executing the entire foreach body. I will attach a partial code.

Для изменения данных.
                if (token.StartsWith("mov"))
                {
                    // Get register and value
                    string register = token.Split(',').GetValue(0).ToString().Substring(4);
                    string value = token.Split(',').GetValue(1).ToString().Trim();

                    // If all is okay...
                    if (regs.ContainsKey(register))
                    {
                        if (txts.ContainsKey(value))
                        {
                            regs[register] = txts[value];
                        }

                        else
                        {
                            regs[register] = value;
                        }
                    }
                    // Else...
                    else
                    {
                        Console.WriteLine("ERROR! NO REGISER CALLED " + register);
                    }     
                }
И генератор этого словаря.
        public static Dictionary<string, string> createRegisters(Array regsToAdd)
        {
            Dictionary<string, string> regs = new Dictionary<string, string> { };

            foreach (var reg in regsToAdd)
            {
                string register = reg.ToString();

                regs.Add(register, "");
            }

            return regs;
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aristarkh Deryapa, 2017-07-06
@isisTance

Solved by unknown shamanism with the code entering the interpreter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question