Page 1 of 1

Does MadCap.OpenHelp() function have default values?

Posted: Thu Jun 14, 2018 5:01 pm
by chuck_agari
In the doc for CSH, the MadCap.OpenHelp() function is described as having 4 parameters: ID, Skin Name, Search String, and First Pick Search String Value. And the examples pretty much all look like this:

MadCap.OpenHelp('Welcome', null, null, null )
MadCap.OpenHelp(1000, null, null, null )
MadCap.OpenHelp('Company/Employees.htm', null, null, null )

Yes, there are a few example that also use another parameter or two to demonstrate the concepts. However...

I'm thinking that for most users in most scenarios, the help calls will look exactly like above, with the last 3 parameters unused and not needed, yet the developers having to enter null, null, null every. Single. Time.

In looking at https://developer.mozilla.org/en-US/doc ... parameters, I see that JavaScript does provide a capability to provide defaults, which would be overridden if the parameter is defined in the function call. I don't see anything about this in the docs, so I assume the function is not defined like that. But I'm thinking it'd work better if the function definition looked something like this:

function OpenHelp(ID=null, SkinName=null, SearchString=null, FirstPickSearchStringValue=null) {
.
.
.
}

That way, in the above examples, developers could writer this code:

MadCap.OpenHelp('Welcome')
MadCap.OpenHelp(1000)
MadCap.OpenHelp('Company/Employees.htm')

Which to me is a LOT cleaner and simpler. What say ye MadCap devs?

Re: Does MadCap.OpenHelp() function have default values?

Posted: Mon Jun 18, 2018 3:21 am
by ChoccieMuffin
As this is a peer support forum, your suggestion might not get seen by Madcap developers, so can I suggest that you click the "Feature requests" link in my signature and send it to them that way?

And welcome to the forums, if nobody has said that already. :)

Re: Does MadCap.OpenHelp() function have default values?

Posted: Mon Jun 18, 2018 1:00 pm
by chuck_agari
ChoccieMuffin wrote:As this is a peer support forum, your suggestion might not get seen by Madcap developers, so can I suggest that you click the "Feature requests" link in my signature and send it to them that way?

And welcome to the forums, if nobody has said that already. :)
Certainly this is true that this is a "peer support" forum. However, I have worked at several companies that have similar forums, and as employees were were at least encouraged, if not required, to monitor, and even contribute, especially as it was the company itself hosting the forums, as is the case here. I do not think it unreasonable to expect a similar expectation of attention here--or at least have the belief that non-participation and non-monitoring is an abdication.

I don't know the details of their source code, so I don't know if this would be a feature request, as in, changing the funciton's signature, or merely a documentation bug, in that the function can do this, but it is undocumented. And unless someone is capable of decompiling the Flare source code, the question is one only members of the Flare development team can answer.

Re: Does MadCap.OpenHelp() function have default values?

Posted: Tue Jun 19, 2018 3:07 am
by ChoccieMuffin
chuck_agari wrote:
ChoccieMuffin wrote:As this is a peer support forum, your suggestion might not get seen by Madcap developers, so can I suggest that you click the "Feature requests" link in my signature and send it to them that way?

And welcome to the forums, if nobody has said that already. :)
Certainly this is true that this is a "peer support" forum. However, I have worked at several companies that have similar forums, and as employees were were at least encouraged, if not required, to monitor, and even contribute, especially as it was the company itself hosting the forums, as is the case here. I do not think it unreasonable to expect a similar expectation of attention here--or at least have the belief that non-participation and non-monitoring is an abdication.

I don't know the details of their source code, so I don't know if this would be a feature request, as in, changing the funciton's signature, or merely a documentation bug, in that the function can do this, but it is undocumented. And unless someone is capable of decompiling the Flare source code, the question is one only members of the Flare development team can answer.
I'm not getting into a discussion about whether they do or whether they should review these forums. I was just suggesting that one way to make sure your suggestion gets logged is to use the link. But that's fine if you don't feel like doing it... :roll: