Try this:
off1=Lthk*SIN(Lang)
off2=Ldep*COS(Lang)
Create a new parameter nb ! number of louvres
Delete the parameter Lspace, declare it as a variable, function of nb
Lspace=(B-gs_frame_width*2-off1-off2)/(nb-1)
FOR I=off1+gs_frame_width TO B-gs_frame_width+0.001 step Lspace
It should work.
If you prefer to keep Lspace, declare nb as a variable, and calculate it with the INT() function.
You will have to calculate a new adjusted value for Lspace, Lspace2 for eg.