Java
import Rational.PureAPI;
class StartStopClass
{
public static void main(String args[])
{
int x;
PureAPI.StopRecordingData();
//The preceding line causes data recording to stop
System.out.println(x = PureAPI.IsRecordingData());
//The preceding line causes a "0" to be displayed,
//verifying that the recording state has changed and,
//in this case, data is no longer being recorded.
InputFunctionA();
System.out.println(x = PureAPI.StartRecordingData());
//The preceding line starts the recording of data
//and also displays the value the function returns,
//as verification that the recording state has changed.
ComputationFunctionB();
ComputationFunctionC();
OutputFunctionD();
}
}
C#
using System;
using Rational;
class StartStopClass
{
public static void Main()
{
int x;
PureAPI.StopRecordingData();
//The preceding line causes data recording to stop
System.Console.WriteLine(x = PureAPI.IsRecordingData());
//The preceding line causes a "0" to be displayed,
//verifying that the recording state has changed and,
//in this case, data is no longer being recorded.
InputFunctionA();
System.Console.WriteLine(x = PureAPI.StartRecordingData());
//The preceding line starts the recording of data
//and also displays the value the function returns,
//as verification that the recording state has changed.
ComputationFunctionB();
ComputationFunctionC();
OutputFunctionD();
}
}
(C) Copyright IBM Corporation 1993, 2009.