summaryrefslogtreecommitdiffstats
path: root/eshtrans/funcparams.esh
diff options
context:
space:
mode:
Diffstat (limited to 'eshtrans/funcparams.esh')
-rw-r--r--eshtrans/funcparams.esh17
1 files changed, 17 insertions, 0 deletions
diff --git a/eshtrans/funcparams.esh b/eshtrans/funcparams.esh
new file mode 100644
index 0000000..cfabe61
--- /dev/null
+++ b/eshtrans/funcparams.esh
@@ -0,0 +1,17 @@
+# Example of parameter lists and argument type checking.
+
+greet(bool doprint, int i, string s)
+{
+ if ${doprint}; then
+ while [ ${i} -gt 0 ]; do
+ printf '%s\n' "${s}"
+ i=$((${i} - 1))
+ done
+ fi
+}
+
+main()
+{
+ greet true 3 'Hello, world!'
+ return 0
+}