Fit with numerical integration and global variables

I am trying to write a fit function that requires numerical integration of a function with three parameters: one fixed, one fit parameter, and the integration variable. I noticed that Integrate1D can only call user functions with a single local variable, and others need to be passed as global variables. Will it cause problems that one of my fit parameters is a global variable?

Thank you.
You should not have a problem.

Suppose you have a fitting function that has two fitting variables w[0] and w[1]. Suppose further that w[1] is involved in the integration function. Your fitting function will look like this:

Function integrationFitFunction(w,x) : FitFunc
	Wave w
	Variable x
	
	return myIntegrationFunction(w,x)
End

Function myIntegrationFunction(w,inX)
	Wave w
	Variable inX
	
        // assuming you are in root: create the global and set its value.
	Variable/G param1=w[1]
	// e.g., integrating from 0 to 1 the integrand shown below.
	return w[0]+Integrate1D(integrationFunction,0, 1)
End


Function integrationFunction(inX)
	Variable inX
	
	NVAR param1=root:param1
	// return the integrand expression using inX and param1,
	// e.g. for a simple param1*inX
	return param1*inX
End


I hope this helps,

A.G.