Documentation of grib_filter
@@ -120,25 +120,27 @@ echo "-# The switch statement is an enhanced version of the if statement. Its sy
echo "\\verbatim"
echo "switch (key1) {"
echo " case val1:"
-echo " # block of rules;"
+echo " # statements"
echo " case val2:"
-echo " # block of rules;"
+echo " # statements"
echo " default:"
-echo " # block of rules"
+echo " # statements"
echo "}"
echo "\\endverbatim\\n"
-echo "Each value of each key given as argument to the switch statement is matched against the values specified in the case statements.\\n"
-echo "If there is a match, then the block or rules corresponding to the matching case statement is executed.\\n"
+echo "The value of the key given as argument to the switch statement is matched against the values specified in the case statements.\\n"
+echo "If there is a match, then the statements corresponding to the matching case are executed.\\n"
echo "Otherwise, the default case is executed. The default case is mandatory if the case statements do not cover all the possibilities.\\n"
echo "The \"~\" operator can be used to match \"anything\".\\n\\n"
-echo "Following is an example showing the use of the switch statement:\\n"
+echo "The following is an example of the switch statement:\\n"
echo "\\verbatim"
-echo "processing paramId=[paramId] [shortName] [stepType]";
+echo "print 'Processing paramId=[paramId] [shortName] [stepType]';"
echo "switch (shortName) {"
-echo " case "tp" :"
-echo " set stepType="accum";"
-echo " case "10u" :"
-echo " set typeOfLevel="surface";"
+echo " case 'tp' :"
+echo " set stepType='accum';"
+echo " print 'Message #[count]: Total Precipitation';"
+echo " case '10u' :"
+echo " set typeOfLevel='surface';"
+echo " print 'Message #[count]: 10m U-Wind';"
echo " default:"
echo "}"
echo "\\endverbatim\\n"
