Counts the number of datasets that begin with the letter F (function datasets) and opens the function's Plot Details dialog box to create a new function named Fn where n is one more than the number of datasets counted. If the FUNCTION.OTP graph template is not opened before executing NewFunction, then the function dataset Fn is created but not plotted.


Def NewFunction {
      list -sn F B;create %B -f 10;
      def ErrorProc [del %B];set %B;del -m ErrorProc;


The following script creates a new graph window from the FUNCTION.OTP template and then creates and plots a new function named F1 (assuming that no other function datasets already exist).

GetEnumWin Function;