Hi, if I try the following code, the border (myvarstart and myvarend) will not be considered. It takes always the whole dataset! I can not find a mistake. Maybe the order of the commands?
The properties you were using, nlsf.databegin, and nlsf.dataend are the correct ones, if what you are trying to do is to restrict the fit to a certain range of the data.
Note that these properties refer to the row number and not the x values - perhaps that was the problem?
I tried your script (with some lorentz data and some fixed values for parameters instead of your variables) and it worked fine in 7.5.
It appears that nlsf.fitdata$ must be defined before nlsf.databegin|dataend in 6.0. This will fit over the desired range and create a fit curve for the same range. (Leaving out the nlsf.xBegin|xEnd|xMode commands will perform the proper fit but create a curve over the full range.)
nlsf.p1=0; iii=1; iii++; // next parameter is p2! nlsf.p$(iii)=MyVarCenter$(iPeak); //some Var iii++; nlsf.p$(iii)=MyVarWidth$(iPeak); //some Var iii++; nlsf.p$(iii)=29000;