cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to design an experiment, explore factor-response relationships, assess tradeoffs, and ID best settings. Register for Sep. 11 Mastering JMP.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

Are nested loops possible using JSL?

Is there a way to script a nested loop statement using JSL? I'm running into errors when I try. I am writing a script that transforms a dataset using indirect lognormal correction for change of support and I think I need a nested WHILE statement to make it work.

Although I realize the syntax is not entirely correct, the following illustration conveys what I am trying to do:

i=1;
j=1;
n=NRow() // with more than 209,000 rows

While( i < n-1,
While( j < n,
s = s + ( data(i) * data(j),
j = j++),
i = i++);

There is always more than one way to accomplish things, so if JSL does not support nested loops does anyone have any suggestions?
2 REPLIES 2
mpb
mpb
Level VII

Re: Are nested loops possible using JSL?

Sure you can nest loops. Here's a very simple example using nested "for" loops. Look in the log for the results.

Re: Are nested loops possible using JSL?

mpb,

You are absolutely correct. Your script works just as it should. The problem with my script turned out to be a bit of code preceding the loop where I tried reusing a variable and it wasn't overwriting the original value the way I thought it would.

Thanks for your help!

Recommended Articles