I thought I can call the following function
Function ErrorMessage(Message as string, Title as string)
with both calls
ErrorMessage(ErrorText)
or
ErrorMessage(ErrorText,ErrorTitle)
No, you cannot simply omit a parameter like that. There are two ways
to achieve what you want. One is to give the title parameter a
default value:
Function ErrorMessage(Message as string, Title as string = "Untitled")
The other alternative is to overload the function:
Function ErrorMessage(Message as string)
...
End Function
Function ErrorMessage(Message as string, Title as string)
...
End Function
The latter makes more sense in cases where omitting the title does
not imply any specific default value.
--
-Thomas
Personal web page: <http://homepage.mac.com/thomasareed/>
My shareware: <http://www.bitjuggler.com/>
Free REALbasic code: <http://www.bitjuggler.com/extra/>
There are 10 kinds of people in the world -- those who understand binary
numbers and those who don't.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|