armorasebo.blogg.se

Keck nirspec zemax file
Keck nirspec zemax file




Keyword OPEN is used to open a text file. The C format specification can be found in any programming reference for the C language.Įxample 2.7-3 shows some applications of keyword FORMAT.įigure 2.7-3 shows the result of the program seen in the pop-up window:īesides the way to type in information from the keyboard, ZPL also supports importing numeric or string information from a text file, with the following keywords and functions: OPEN,READ,READNEXT,READSTRING,CLOSE, EOFF( ) The optional keyword LIT (for literal) indicates the value should be printed according to the “C” language format specifier. The optional keyword INT indicates the value should be first converted to an integer and printed in integer format using the number of places specified by m. The optional keyword EXP after the m.n expression indicates exponential notation should be used. The value n refers to the number of places to display after the decimal point. The value m refers to the total number of characters to be printed, even though some of them may be blank. values stored as variables cannot be used. The values for m and n used must be explicit, i.e. The integers m and n are separated by a decimal point. FORMAT can be used to control the output numerical precision format of the message window or the file. Keyword PRINT is often used with another keyword FORMAT. Figure 2.7-2 is the result of the program seen on the screen and in different files: In this example, we assume the folder “D:\My Macros\ch2\output_files\” already exists, otherwise ZEMAX will report error message. Further, if APPEND is used with OUTPUT, then the result will be added at the end of the corresponding file without overwriting the existing content of the file.Įxample 2.7-2 shows an application of keyword OUTPUT: If OUTPUT is followed by filename$, then the following PRINT command will output the result into the corresponding file. If OUTPUT is followed by SCREEN, then the following PRINT command will display the result on the screen. In fact, PRINT not only can output messages to the display, but can also output messages to files. We know in previous sections that ZPL can output numerical or string information to the message window using keyword PRINT. When the user type in the numerical or string information and press OK button to confirm, the value typed in will be stored in the corresponding variable, and the program continues to run. 2.7-1 The first pop-up window of running program ex20701.ZPL When the program runs to each INPUT command, a dialog window will pop up, showing corresponding messages and waiting for the input, as shown in figure 2.7-1:įig. The syntax of INPUT is: INPUT "Prompt String", variableĮxample 2.7-1 shows an application of keyword INPUT: ZPL provides a keyword INPUT to allow user type in numerical or string information when a program is running. You don’t need to read it from beginning to end, but when you need it, it’s handy. You can now purchase a paperback version of this book from Amazon:įor a beginner who wants to master the tool of ZPL, this is a good tutorial to make your learning process less stressful and more fun.Įven if you are an experienced Zemax user, it is still a good idea to keep this book as a reference.






Keck nirspec zemax file