Page 1 of 1

[Implemented] Optional/default function parameters

Posted: Mon Jun 10, 2002 4:47 pm
by BackupUser
Restored from previous forum. Originally posted by Hi-Toro.

First of all, thanks again for 3.20 Fred -- tons of cool stuff in there :)

I'd really like something from Blitz, if possible: you can make functions with optional parameters, and you provide default values if they aren't passed. For example...

Function Whatever (x, y, z, a = 999, b = 0, c = 32)
...
End Function

Then I can either supply new values for a, b, c:

Whatever (0, 0, 0, 1, 1, 1)

Or skip them completely to use the defaults:

Whatever (0, 0, 0)

This is so nice to use, and I found that C does it too (I was playing with HiSoft C on WinUAE last night :wink:


--
See ya,
James L Boyd.
http://www.hi-toro.com/
--