Thank you for the reply. I created an example that mimics my actual problem in terms of the structure of the package. Here I used Private command without a problem. That is why I am little confused.
Here is that example.
Get[FileNameJoin[{NotebookDirectory[EvaluationNotebook[]],
"TFPackageSourceCodedifference.wl"}]];
Manipulate[
DynamicModule[{f = Sin[x], xR = 1, xL = 0,
Res = 0.4596976941318603`16, NRes = 0.4596976941318603`16},
Column[{Row[{"Lower Limit ", InputField[Dynamic[xL], Number]},
Spacer[5]],
Row[{"Upper Limit ", InputField[Dynamic[xR], Number]}, Spacer[5]],
Row[{"Function ", InputField[Dynamic[f]]}, Spacer[20]],
Button[Style["Calculate", Green, Bold],
Dynamic[Res =
TFPackageSourceCodedifference`WD1Int[f, xR, xL, np, nw];]],
Dynamic[NRes =
TFPackageSourceCodedifference`ND1Int[f, xR, xL, nw, np];],
Row[{"Result", InputField[Dynamic[Res], Enabled -> False]},
Spacer[51]],
Row[{"Symbolic",
InputField[Dynamic[NRes[[1]]], Enabled -> False]}, Spacer[35]],
Row[{"Difference",
InputField[Dynamic[NRes[[2]]], Enabled -> False]}, Spacer[35]]
}]], {{np, 16, "NumberFormat"},
ControlPlacement -> Bottom}, {{nw, 16, "WorkingPrecision"},
ControlPlacement -> Bottom},
Initialization :> (Get[
FileNameJoin[{NotebookDirectory[EvaluationNotebook[]],
"TFPackageSourceCodedifference.wl"}]];)]
and the package
BeginPackage["TFPackageSourceCodedifference`"];
WD1Int::usage="";
ND1Int::usage="";
Clear[Global`x];
Begin["`Private`"];
WD1Int[f_,xR_,xL_,np_,nw_]:=Module[{xLcheck,xRcheck},xLcheck=NumberQ[xL];
xRcheck=NumberQ[xR];
If[xLcheck==True&&xRcheck==True,ResultTF=SetPrecision[NIntegrate[f,{Global`x,xL,xR},WorkingPrecision->Re[IntegerPart[nw]]],Re[IntegerPart[np]]],"Enter numeric inputs for Lower and Upper Limits"];
Return[ResultTF]];
ND1Int[f_,xR_,xL_,nw_,np_]:=Module[{xLcheck,xRcheck},xLcheck=NumberQ[xL];
xRcheck=NumberQ[xR];
numintwolf=WD1Int[f,xR,xL,np,nw];
If[xLcheck==True&&xRcheck==True,
ResultTFSym=SetAccuracy[Integrate[f,{Global`x,xL,xR}],nw];
DifferenceSymNum=ResultTFSym-numintwolf;
,"Enter numeric inputs for Lower and Upper Limits"];
Return[{ResultTFSym,DifferenceSymNum}]];
End[];
SetAttributes[{WD1Int,ND1Int},{ReadProtected,Protected,Locked}];
EndPackage[];
I dont know why using private does not create a problem without introducing the variable as you mentioned.
Erdem