Maybe this has been discussed on the list before
but if I copy/paste the example in the users-guide
about how to use optional arguments in a function:
print-vals: func [arg1 arg2 [any-type!]] [
print either value? 'arg2 [[arg2 arg1]][arg1]
]
print-vals "abc"
abc
print-vals "abc" 123
123 abc
I never get the example results. If I don't really pass a
second value to print-vals I get a "Script Error - "abc" has
no value". If I try:
f: func [a [any-type!]][print "hello"]
f
Now I get no Script Error but the function never gets called
("hello" doesn't print unless I actually pass an arg).
I've tried this with the same results on /Core, /Command, and /View.
What am I doing wrong?
TIA,
Rodney