When the program reaches this line it evaluates the expression and if the answer is false (i.e.
the expression evaluates to 0.0) the rest of the line is ignored. Otherwise the command is
executed.
For example
:
If CountsPerSec < 30000 Then Print Status, “Count Rate too small”;
Pause 5
This will check if the count rate is below 30000 and if it is will display the message in the status
bar. It will then pause for 5 seconds.
What happens if the expression is false?
The message is not displayed, the program goes to the
next line and there is still a 5 second pause. We only want the pause if the message has been
displayed so we could write instead:
If CountsPerSec < 30000
Then Print Status, “Count Rate too smalll”; :
Pause 5
This time the group of commands after
Then
is executed if true and ignored if false. Note that
the commands after the Then must all be on one line. The enter key should be pressed after
...Pause 5 (enter key).
We could go on in this way adding commands separated by colons.
The line might then become
very long or difficult to read. In this case we could use the block form of the structure. This form
is:
If expression Then
command
....command
....
End if
Again the expression is tested and if it is true the sequence of commands following the
If ... Then
line is executed up to the line
End if
.
For example:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Beep
Pause 5
Print Status, Add more sample and re-run”;
End if
There is one more stage to go.
Consider:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Pause 5
End if
Print Report
Introduction to Zetasizer basic
MAN 0179
Page 2.7
Artisan Scientific - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisan-scientific.com
Summary of Contents for Zetasizer 1000
Page 11: ...Artisan Scientific Quality Instrumentation Guaranteed 888 88 SOURCE www artisan scientific com...
Page 16: ...Artisan Scientific Quality Instrumentation Guaranteed 888 88 SOURCE www artisan scientific com...
Page 34: ...Artisan Scientific Quality Instrumentation Guaranteed 888 88 SOURCE www artisan scientific com...
Page 38: ...Artisan Scientific Quality Instrumentation Guaranteed 888 88 SOURCE www artisan scientific com...
Page 116: ...Artisan Scientific Quality Instrumentation Guaranteed 888 88 SOURCE www artisan scientific com...