Using the DO_META Command

The syntax for the do_meta command is:

do_meta "meta_command"

The meta command enclosed in quotes need not be preceded by a “>”.

The do_meta command executes a meta command from within a ~clean blockor proc. It is most useful in a proc because that is where you issueconditional statements. Unlike standard meta commands which executeimmediately when issued, do_meta commands are executed in the regularcourse of a run’s progress. A do_meta command in a proc definitiondoes not execute until the proc is executed.

Some examples of where do_meta can be very useful are:

  1. do_meta allows you to execute a meta command based on the results of an if statement.
  2. do_meta allows you to bypass a meta command by using goto.

Most of the meta commands have the intention that they will be executed immediately. Many meta commands are intended only to setupMentor’s environment, and then remain true or on for the entire run.There are some that are quite useful when combined with the do_meta operator.

Some examples of these are:

  1. >define – Using do_meta to execute a >define makes it so that you can set a >define based on a condition in the data.
  2. >system – Calls to an operating system can now be issued based on the results of an if condition.
  3. >quit or >halt – A Mentor run may be stopped when a certaincondition is met.
  4. >printfile – A printfile’s name, page_width, laser_control, etc.can be chosen based on the contents of the data.
  5. >createdb or >usedb – Using do_meta, you can allow the data todictate the options used on these commands.

Example Spec:

~comment&dometa.doc~defproc={quit:if [1]=1 thenprint "One is a one."elseprint "One is not a one, so Mentor will quit."do_meta "quit"endifprint "Out of the if statement."}proc={data:if [1]=1 thendo_meta ">define @data dometa1.asc"elsedo_meta ">define @data dometa2.asc"endifgoto dont_dodo_meta "stop_watch"dont_do:}~input $~clean m [1]=1~excproc=quitproc=data~input @data ascii=80~cleanprint "s" [1.10$]do_meta "printfile dometa"print "s" [1.10$]~input $~clean m [1]=0~exc proc=quit~end