AFAIK function arguments are required when calling a function. I'm not sure
how you are trying to use the function, but you have a couple of options.
1) You can pass ANY value to a function argument. This includes none!.
Example:
tst: func [
{help for tst...}
x [integer! none!]
][
if none? x [help tst]
print x
]
some-value: none
tst some-value
2) If you know ahead of time (prior to the function call) whether you need
to pass an additional argument to the function, you can use a function
refinement to specify that an additional argument is needed. Example:
tst: func [
{help for tst...}
/nohelp
x [integer!]
][
either nohelp [print x][help tst]
]
some-value: none
either none? some-value [
tst
][ tst/nohelp some-value ]
- Michael Jelinek
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 13, 2000 10:24 AM
To: [EMAIL PROTECTED]
Subject: [REBOL] Function without argument ...
Hi !
Newbie question !!!
Is 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
Eric