12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

26.FOURC> while (wait(0x22)) {27.more> getangles28.more> printf("%10.4f\r", A[tth])29.more> }30.FOURC>As in C, continue and break statements may be used within loops. The statementexit can be used anywhere and always causes a jump back to the command level.MacroFacilityOne of <strong>spec</strong>’s most powerful features is its provision for defining macros. Throughmacros, you can simplify use of the diffractometer as well as determine the style andformat of the data output. Through the macro facility, you can customize the environmentto include any enhancements or <strong>spec</strong>ialized requirements for your experiment.Standard macro sets included in the <strong>spec</strong> package support conventional twocircle,four-circle and z-axis diffractometers along with some <strong>spec</strong>ialized liquid surfacediffractometers. These macros control the measurement and the recording ofexperimental data and establish a standard format for ASCII data files.An example of a simple macro that can be used to record a comment on the printer is30.FOURC> def com ’31.quot> on(PRINTER)32.quot> printf("$*\n")33.quot> off(PRINTER)34.quot> ’35.FOURC>Notice the prompt shows the program is expecting the quote to be closed. The variablePRINTER contains a string naming the printer device used to document thediffractometer operation. To use the above macro, type:35.FOURC> com This is a comment.This is a comment.36.FOURC>The text This is a comment is substituted in the printf() function for the symbol$* and is printed on both the screen and the printer.Each argument following a macro call is available to the macro using $1, $2, ... ,where $1 refers to the first argument, and so on. Up to 25 arguments may be used.An argument is a string of characters separated by white space (spaces and tabs) orenclosed in single or double quotes, $* represents all the arguments, and $# is thenumber of arguments.22 USER MANUAL AND TUTORIALS INTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!