summaryrefslogtreecommitdiff
path: root/macros/GeneralFunctions/SCI2CNInArgCheck.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/GeneralFunctions/SCI2CNInArgCheck.sci')
-rw-r--r--macros/GeneralFunctions/SCI2CNInArgCheck.sci26
1 files changed, 26 insertions, 0 deletions
diff --git a/macros/GeneralFunctions/SCI2CNInArgCheck.sci b/macros/GeneralFunctions/SCI2CNInArgCheck.sci
new file mode 100644
index 0000000..71b9332
--- /dev/null
+++ b/macros/GeneralFunctions/SCI2CNInArgCheck.sci
@@ -0,0 +1,26 @@
+function SCI2CNInArgCheck(NInArgs,MinNArgs,MaxNArgs)
+// function SCI2CNInArgCheck(NInArgs,MinNArgs,MaxNArgs)
+// -----------------------------------------------------------------
+// #RNU_RES_B
+// Check that NInArgs is in the range specified by MinNArgs and
+// MaxNArgs.
+//
+// Input data:
+// NInArgs: number of input arguments of the function under test.
+// MinNArgs: minimum number of input arguments allowed.
+// MaxNArgs: maximum number of input arguments allowed.
+//
+// Output data:
+// ---
+// #RNU_RES_E
+//
+// Status:
+// 23-Nov-2007 -- Raffaele Nutricato: Author.
+//
+// Copyright 2007 Raffaele Nutricato
+// -----------------------------------------------------------------
+
+if ((NInArgs < MinNArgs) | (NInArgs > MaxNArgs))
+ error(9999, 'Incorrect number of input arguments.');
+end
+endfunction