Beispiel #1
0
        public static String[] INPUT(LMD_BLOCKS.BlockInput b)
        {
            String[] code     = new String[2];
            String   variable = b.GetVariable();
            String   view     = b.GetPreviewText();

            if (view != "")
            {
                code[0] = "	cout << \"" + b.GetPreviewText() + "\";";
                if (variable != "")
                {
                    INFO_VARIABLE info_variable = ManagerVariables.GetVar(variable);
                    code[1] = "	cin >> " + b.GetVariable() + ";";
                }
                else
                {
                    code[1] = "	// Ввод данных пропущен";
                }
            }
            else
            {
                if (variable != "")
                {
                    INFO_VARIABLE info_variable = ManagerVariables.GetVar(variable);
                    code[1] = "	cin >> " + b.GetVariable() + ";";
                }
                else
                {
                    code[1] = "	// Блок ввода не реализован";
                }
            }

            return(code);
        }
Beispiel #2
0
        public static String[] INPUT(LMD_BLOCKS.BlockInput b)
        {
            String[] code     = new String[2];
            String   variable = b.GetVariable();
            String   view     = b.GetPreviewText();

            if (view != "")
            {
                code[0] = "		Console.WriteLine(\""+ b.GetPreviewText() + "\");";
                if (variable != "")
                {
                    INFO_VARIABLE info_variable = ManagerVariables.GetVar(variable);
                    code[1] = "		"+ b.GetVariable() + " = " + info_variable.type + ".Parse(Console.ReadLine());";
                }
                else
                {
                    code[1] = "		Console.ReadLine();";
                }
            }
            else
            {
                if (variable != "")
                {
                    INFO_VARIABLE info_variable = ManagerVariables.GetVar(variable);
                    code[0] = "		"+ b.GetVariable() + " = " + info_variable.type + ".Parse(Console.ReadLine());";
                }
                else
                {
                    code[0] = "		Console.ReadLine();";
                }
            }

            return(code);
        }