Labs/The lab Verb

From J Wiki
Jump to navigation Jump to search
Labs | Basic Usage | The lab Verb | Script Layout | Lab Commands | Deprecated Commands | Migration

The lab Verb

The lab verb is all that is needed to run through a lab.

In normal use, the arguments are:

 lab {scriptname}       load the script as a lab

 lab 0                  run next step

 lab ''                 show the lab status

 lab ':'                list lab chapters
 lab ':name'            run line starting at given chapter

It is also possible to move backwards and forwards through a script, and to run several lines at once. This can be helpful when developing a lab:

 lab -1                 rerun last step
 lab -n                 rerun n steps back

 lab n                  run line n
 lab n m                run lines n through m (to max script length)

Note that the line numbers refer to the lines as parsed from the script, not the source line numbers.

For example:

 lab 1                  return to and run first line of lab
 lab 1 _                run all lines of lab
 lab n _                run rest of lab from line n