SetVariable() public méthode

public SetVariable ( string name, STObject value ) : bool
name string
value STObject
Résultat bool
Exemple #1
0
 public STObject(STClass @class)
 {
     Class = @class;
     InstanceContext = new LocalContext(GlobalContext.Instance, true);
     InstanceContext.Declare("self");
     InstanceContext.SetVariable("self", this);
 }
Exemple #2
0
        public override STObject Invoke(STMessage message)
        {
            try {
                var instanceCtx = message.Receiver.InstanceContext;
                var invocationCtx = new LocalContext (instanceCtx);
                for (int i = 0, max = Prototype.ParameterNames.Length; i < max; ++i)
                    invocationCtx.SetVariable(Prototype.ParameterNames[i].Name, message.Parameters[i]);

                return Block.EvaluateWith(invocationCtx);
            } catch (ReturnException e) {
                return e.Value;
            }
        }