Chapters: 1: Introduction 2: Simple example 3: Invocation 4: Finer Control 5: X-Y Plots 6: Contour Plots 7: Image Plots 8: Examples 9: Gri Commands 10: Programming 11: Environment 12: Emacs Mode 13: History 14: Installation 15: Gri Bugs 16: Test Suite 17: Gri in Press 18: Acknowledgments 19: License Indices: Concepts Commands Variables |
10.6: If StatementsGri has `if ' statements to make your programs more flexible.
Here's an example:
If you answer 1 to the question, the line thickness will be set at 2 points. If you answer 0 then a thin line will be used. If you press carriage return a thin line will be used.
The item following the `
There is no need to put the else part in if you don't need it. You can do
if you wish. If you want just the else part, you can do
(The exclamation point denotes logical negation: `
If statements may be nested many levels deep. You may also have
`
|