Parameter with colon

Parameter with colon

  

hi there i want to ask about the parameter in this function:

SyntaxEditor Code Snippet

Index(vfilename,".",startIndex:,searchFromEnd:,ignoreCase:)

That function works, although i do not give values for StartIndex:, searchFromEnd:, and ignoreCase:.

My question is what does the parameter with colon means and how to give them values? 


thank you & regards, 

ib.

You can delete those parameters you don't use. 

Index(vfilename,".")

Will work just fine. But what do you mean with "colon" ?

Niels Favreau wrote:

You can delete those parameters you don't use. 

Index(vfilename,".")

Will work just fine. But what do you mean with "colon" ?

COLON (:) - end of every parameter. If i do not delete them, it is okay too. My question is what does the parameter with colon mean? tq


Solution

Hi Indra,

Those are simply the input parameters to that function. The reason the function still works fine without you supplying anything is because they are non-mandatory inputs.

You do not necessarily need the name of the input parameter with the colon to specify an input, however, if you do not supply the name like 'Input:', you must supply the input parameters in the correct order the function calls for them.

For instance:

Index(t:".",startIndex:0,searchFromEnd:False,ignoreCase:False,search:vfilename)

Here, since all the inputs are specified, I do not have to have them in the proper order.

Otherwise you would need to do it in order:

Index(vfilename,".", 0, False, False)

Or, if you aren't using the optional parameters you can simply use (the optional parameters will use their specified default values):

Index(vfilename,".")

Hope this helps,

Justin

Solution

Thank you, so in my case, the first two parameters are set without the parameter's names and the rest are set with parameter's names with default values are given by the systems. 

indra budiantho wrote:

Thank you, so in my case, the first two parameters are set without the parameter's names and the rest are set with parameter's names with default values are given by the systems. 

Exactly.