Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Inconsistency in Builder compiler
Robert_Davies_(unlondonadmin_-_(deleted))
I don't understand this, if I define an OScript function:function String Patch( \ String directory = undefined, \ Integer minPatchLevel = 0 ) //Stuff here returnendThe compiler complains that I must return a string. Fair enough. But if I define the function:function String Patch( \ String directory = undefined, \ Integer minPatchLevel = 0 ) //stuff hereendThe compiler does not complain even though I am again not returning a string.Is this a bug in the compiler? What is being returned if there is no return statement?Best regards/matt.
Find more posts tagged with
Comments
Jim_Brezina
The default return value for a function when no value is specified is the Undefined value. This is one of the features that contributes to OScript's conciseness. It differs from traditional languages, which would usually issue an error in this context.