In einer eMail vom 13.03.00 19:34:33 (MEZ) Mitteleurop�ische Zeit schreibt
[EMAIL PROTECTED]:
<< s it possible to test a lack of argument in a function ?
I try things like this but... it doesn't work !
tst: func [
{help for tst...}
x [integer!]
][
if none? x [help tst]
print x
]
tst
** Script Error: tst expected x argument of type: integer.
** Where: tst
>>
Yes, i saw something in the userguide by functions. i hope it was
x [anytype?], no [any-type?]
--
users/expfunctions.html#OptionalArguments :
Optional Arguments
Functions can be created that take arguments optionally. Do this by
specifying the any-type! datatype identifier in the argument specification
block:
print-val: func [val [any-type!]] [
print either value? 'val [val]["No value given"]
]
print-val 1234
1234
print-val
No value given
(...and a bit more)
Volker