public override void Evaluate() { // Todo: let the user specify a volume "LOG something TO file ON volume" var targetVolume = SelectedVolume; // If the archive is out of reach, the signal is lost in space. if (!targetVolume.CheckRange()) { State = ExecutionState.DONE; return; } var targetFile = RegexMatch.Groups[2].Value.Trim(); var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); if (e.IsNull()) { State = ExecutionState.DONE; } else { targetVolume.AppendToFile(targetFile, e.ToString()); State = ExecutionState.DONE; } }
public override void Evaluate() { var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); if (e.IsNull()) { StdOut("NULL"); State = ExecutionState.DONE; } else { StdOut(e.ToString()); State = ExecutionState.DONE; } }
public override void Evaluate() { var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); var ex = new Expression.Expression(RegexMatch.Groups[2].Value, ParentContext); var ey = new Expression.Expression(RegexMatch.Groups[3].Value, ParentContext); if (e.IsNull()) throw new KOSException("Null value in print statement"); int x, y; if (Int32.TryParse(ex.ToString(), out x) && Int32.TryParse(ey.ToString(), out y)) { Put(e.ToString(), x, y); } else { throw new KOSException("Non-numeric value assigned to numeric function", this); } State = ExecutionState.DONE; }
public override void Evaluate() { var e = new Expression.Expression(RegexMatch.Groups[1].Value, ParentContext); var ex = new Expression.Expression(RegexMatch.Groups[2].Value, ParentContext); var ey = new Expression.Expression(RegexMatch.Groups[3].Value, ParentContext); if (e.IsNull()) { throw new KOSException("Null value in print statement"); } int x, y; if (Int32.TryParse(ex.ToString(), out x) && Int32.TryParse(ey.ToString(), out y)) { Put(e.ToString(), x, y); } else { throw new KOSException("Non-numeric value assigned to numeric function", this); } State = ExecutionState.DONE; }