If the test is false the block is ignored and the
Print Report
will be executed. But, if it is true we
will get the warning and still get the
Print Report
. We could get round this in two ways. The
GoTo
command could be used:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Pause 5
GoTo 20
End if
Print Report
20 ‘ This is where to continue.
The neater and clearer solution is to write
:
If CountsPerSec < 30000 Then
Print Status,“Count Rate too small”;
Pause 5
GoTo 20
Else
Print Report
End if
This general form
:
If expression Then
command
command
...
Else
command
command
...
End if
executes the first block of commands if the expression is true and the second block if false.
2.7.2
Subroutines
Suppose that you write a test
:
If CountsPerSec < 30000 Then
Print dialogue, Using, “###.### is too large”, ResultBelow (10 )
Beep
Pause 5
End if
and subsequently want to test some other parameters, say ResultAbove ( 60 ), etc. in the same
way. You could write lots of bits of code copying the above.
The better way would be to use a subroutine.
MAN0179
Page 2.8
Zetasizer 1000/2000/3000/4000/5000/4700
Artisan Scientific - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisan-scientific.com
Summary of Contents for Zetasizer Series
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...