Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
3.5.6. Using Arrays in Conditional Statements
if
statements. This is useful if you want to execute a subroutine once a value in the array matches a certain condition. Consider the following example:
Example 3.17. vfsreads-print-if-1kb.stp
if
statement in the script converts and prints it out in kB
.
You can also test whether a specific unique key is a member of an array. Further, membership in an array can be used in if
statements, as in:
if([index_expression] in array_name) statement
if([index_expression] in array_name) statement
Example 3.18. vfsreads-stop-on-stapio2.stp
if(["stapio"] in reads)
statement instructs the script to print stapio read detected, exiting
once the unique key stapio
is added to the array reads
.