public override void Evaluate() { // Todo: let the user specify a volume "LOG something TO file ON volume" Volume targetVolume = SelectedVolume; // If the archive is out of reach, the signal is lost in space. if (!targetVolume.CheckRange()) { State = ExecutionState.DONE; return; } String targetFile = RegexMatch.Groups[2].Value.Trim(); Expression e = new Expression(RegexMatch.Groups[1].Value, ParentContext); if (e.IsNull()) { State = ExecutionState.DONE; } else { targetVolume.AppendToFile(targetFile, e.ToString()); State = ExecutionState.DONE; } }
public override void Execute(SharedObjects shared) { string fileName = shared.Cpu.PopValue().ToString(); string expressionResult = shared.Cpu.PopValue().ToString(); if (shared.VolumeMgr != null) { Volume volume = shared.VolumeMgr.CurrentVolume; if (volume != null) { volume.AppendToFile(fileName, expressionResult); } else { throw new Exception("Volume not found"); } } }