comparison scripts/strings/strcat.m @ 3180:c17387059fd3

[project @ 1998-09-24 18:59:11 by jwe]
author jwe
date Thu, 24 Sep 1998 19:00:19 +0000
parents 8b262e771614
children 4f40efa995c1
comparison
equal deleted inserted replaced
3179:f657159c8152 3180:c17387059fd3
24 ## Author: jwe 24 ## Author: jwe
25 25
26 function st = strcat (s, t, ...) 26 function st = strcat (s, t, ...)
27 27
28 if (nargin > 1) 28 if (nargin > 1)
29 if (isstr (s) && isstr (t)) 29 save_empty_list_elements_ok = empty_list_elements_ok;
30 tmpst = [s, t]; 30 unwind_protect
31 else 31 empty_list_elements_ok = 1;
32 error ("strcat: all arguments must be strings"); 32 if (isstr (s) && isstr (t))
33 endif 33 tmpst = [s, t];
34 n = nargin - 2;
35 while (n--)
36 tmp = va_arg ();
37 if (isstr (tmp))
38 tmpst = [tmpst, tmp];
39 else 34 else
40 error ("strcat: all arguments must be strings"); 35 error ("strcat: all arguments must be strings");
41 endif 36 endif
42 endwhile 37 n = nargin - 2;
38 while (n--)
39 tmp = va_arg ();
40 if (isstr (tmp))
41 tmpst = [tmpst, tmp];
42 else
43 error ("strcat: all arguments must be strings");
44 endif
45 endwhile
46 unwind_protect_cleanup
47 empty_list_elements_ok = save_empty_list_elements_ok;
48 end_unwind_protect
43 else 49 else
44 usage ("strcat (s, t, ...)"); 50 usage ("strcat (s, t, ...)");
45 endif 51 endif
46 52
47 st = tmpst; 53 st = tmpst;