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.

print the string or number value, depending on the format <strong>spec</strong>ification. If the stringvalue cannot be interpreted as a number, its number value is zero. All number valuesare maintained as double-precision floating-point quantities.Uninitialized variables have a number value of zero and a string value of "" (the nullstring). Although associative array indices are internally derived from the stringvalue of the index expression, if the index is an uninitialized variable, its value forpurposes of indexing the array is the string "0" .Functions such as input() , getline() , gpib_get() and ser_get() return stringvalues that possibly represent numbers. When the string is used in a number context,automatic string to number conversion takes place. The conversion rulesrequire that there are no extraneous characters in the string. An initial 0x or 0Xintroduces a hexadecimal integer. Aninitial 0 introduces an octal constant, unlessthere is a decimal point or an e or E exponential string, in which case the entirestring is interpreted as a decimal number,leading zero notwithstanding.Built-In Var ia blesThe following is a list of most of <strong>spec</strong>’s built-in variables. Some site-dependent code,along with most of the standard diffractometer geometry code, will create additionalbuilt-in variables. Also, motor and counter mnemonics entered in the hardware configurationfile become built-in variables when the config file is read by <strong>spec</strong>.A[] — is an array dimensioned to the number of motors as obtained from the configfile. The function read_motors(0) fills the array with user angles. The usercan assign values to any of the elements. The commands move_all andmove_cnt use the values in the array. Also, the various site-dependent, geometry-<strong>spec</strong>ificcalculations, accessed through the calc() user-hook function, basetheir results on the values in this array or place new values in it.COLS — is a number-valued variable set to the number of text columns on the userterminal or workstation window. The value is used for formatting text-modeplots and on-line help files. COLS is generally automatically assigned a valuefrom the system terminal data base when <strong>spec</strong> starts up, or, ifavailable, byusing the TIOCGWINSZ command in the ioctl() system call whenever a value forCOLS is needed.COUNTERS — is the number of counters being used as determined from reading theconfig file.CWD — is a string-valued variable that contains the name of the user’s current workingdirectory. Itisassigned a value when <strong>spec</strong> starts up, and is updated eachtime the chdir() function is executed.56 REFERENCE MANUAL 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!