Eggheads: optional parameters in proc definition

Jeff Fisher guppy at techmonkeys.org
Fri Jul 16 19:14:42 CST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

CoolCold wrote:

| Hello Eggdrop,
|
| Can anyone tell me - is there is a way to define proc with optional
| parameter(s) ?
|
| proc test { param1 param2 (optional param3) } {
| ....
| }

You were close.

proc test {param1 param2 {param3 "default"}} {
	puts "param1: $param1"
	puts "param2: $param2"
	puts "param3: $parms3"
}

test blah1 blah2
test blah1 blah2 blah3

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFA+H2CGi4Ni4h3f1YRAiRAAKCPqUYVxn839RSanFQboNfgS27tqwCfc4ri
fSfYTMNJXNYRicbnA1G96PE=
=1KTd
-----END PGP SIGNATURE-----




More information about the Eggheads mailing list