AjTalk.Language.Block.CompileSet C# (CSharp) Method

CompileSet() public method

public CompileSet ( string name ) : void
name string
return void
        public virtual void CompileSet(string name)
        {
            if (this.TryCompileSet(name))
            {
                return;
            }

            this.CompileByteCode(ByteCode.SetGlobalVariable, this.CompileGlobal(name));
        }

Usage Example

Example #1
0
        public void CompileAndRun()
        {
            Machine machine = new Machine();

            Block block;

            block = new Block();
            block.CompileArgument("newX");
            block.CompileGet("newX");
            block.CompileSet("GlobalX");

            block.Execute(machine, new object[] { 10 });

            Assert.AreEqual(10, machine.GetGlobalObject("GlobalX"));
        }
All Usage Examples Of AjTalk.Language.Block::CompileSet