Non Compulsory Parameters & a Null Constant ?
Non Compulsory Parameters & a Null Constant ?
- Subject: Non Compulsory Parameters & a Null Constant ?
- From: Adam Hinshaw <email@hidden>
- Date: Wed, 12 Feb 2003 15:10:55 +1100
hi all.
couple of basic queries.
is there a way to specify parameters in a handler that are not compulsory in
a call to that handler.
eg;
on getFoo(bar)
(*do stuff*)
end
set myVar to getFoo(12) -- current way
but what if i did not want to pass a param as my handler will use a default
value instead or respond in a different manner,
eg;
set myVar to getFoo() -- gets a runtime error "...doesn't match the
parameters"
So is there away around these errors.
Seems like it is quite strict in a C sense of requiring values / Doesn't
make sense considering how loose every thing else is.
---
Some what related other question.
Is there a constant along the lines of NULL or VOID from other languages
My desire for this is to determine if a variable already exists.
eg,
on getFoo(bar)
if bar equals NULL then
set bar to 0
end if
end
thanks
adam.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.