# Having Optional in function parameters

**URL:** <https://forum.kirupa.com/t/having-optional-in-function-parameters/157844>\
**Category:** Uncategorized\
**Created:** [August 4, 2005, 5:37pm UTC](https://forum.kirupa.com/t/having-optional-in-function-parameters/157844 "2005-08-04T17:37:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skOOb](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@skOOb](https://forum.kirupa.com/u/skOOb)\
**Post date:** [August 4, 2005, 5:37pm UTC](https://forum.kirupa.com/t/having-optional-in-function-parameters/157844/1 "2005-08-04T17:37:17Z")

</div>

[font=Tahoma]How do I go about setting up a function to optionally take a parameter? For example, to call a function like the following[/font]  
[font=Tahoma][/font]  
[font=Tahoma]test(1,2,3)[/font]  
[font=Tahoma]test(1,2,3,4)[/font]  
[font=Tahoma][/font]  
[font=Tahoma]Both of these would call the same function, but parameter 4 is optional. I have done this in [VB.NET](http://VB.NET) with ‘Optional’ and I can default the missing parameter. Is this possible in AS?[/font]  
[font=Tahoma][/font]  
[font=Tahoma]thanks,[/font]  
[font=Tahoma]the skOObs[/font]
