Editing
Scanco User Instructions
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Reading from files=== Sometimes you have a list of files (for example Micro-CT scans) that are to be processed in a certain way. The obvious way is to copy-paste the code several times, changing only the name of the file, but this is error-prone and inefficient. *A better way is to put the list of models into a text file, and then call a subroutine on each model file. For example: <pre> $ CLOSE/NOLOG foo $ OPEN/READ foo DISK3:[MICROCT.PROJECTS.OWOC.COM]MYLIST.TXT $read_loop: $ READ/END=done foo myline $ CALL process_me 'myline' $ GOTO read_loop $done: $ CLOSE/NOLOG foo $ EXIT $process_me: SUBROUTINE $ scriptname = DISK3:[MICROCT.PROJECTS.OWOC.COM]MYSCRIPT.COM $ SUBMIT/NOPRINT/QUE=SYS$FAST/PARAM='P1' 'scriptname' $ EXIT $ ENDSUBROUTINE </pre> *The first line closes the file handle, in case it was left open in a previous script. *The second opens the file "MYLIST.TXT" for reading, and assigns the open file a handle named "foo". *A loop reads the file line-by-line, calling a subroutine with the contents of each line. *When the end of the file is reached, the file is closed and the script exits. [[Image:Redirect.jpg|15px]] [[#top|''Return to Contents'']] or [[Main_Page|''Return to Main Page'']]
Summary:
Please note that all contributions to bone.wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BoneWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
associated-pages
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Documents
Recent changes
Help
Tools
What links here
Related changes
Page information