Forum Discussion
- chrisccContributor
I would suggest additional function parameter (boolean will work) that will exclude the code if you set it to true. Maybe something like this could work. I hope it helps.
function script1(fileName, text, optionalExcludeCode)
{
// code that always runs
// optionalExcludeCode is null or false then run code in if statement
if (optionalExcludeCode == null || !optionalExcludeCode)
{
// code that will be excluded if optionalExcludeCode is set to true
}
// code that always runs
// optionalExcludeCode is null or false then run code in if statement
if (optionalExcludeCode == null || !optionalExcludeCode)
{
// code that will be excluded if optionalExcludeCode is set to true
}
// repeat as needed....
}
function script2 (fileName, text)
{
script1(fileName, text, true)
}
Related Content
- 13 years ago
- 2 years ago
- 12 years ago
Recent Discussions
- 3 hours ago
- 6 days ago
- 10 days ago