Subscribe Bookmark RSS Feed

Possible code bug with limit extraction

Hi Guys,

I am using the following JMP snippet as a part of a larger program. Problem is I get a invalid row number -1 error. When I step through the code with the debugger once and then run the code, I do not get this error and everything runs fine. What may be wrong with this code?

7 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

Try using different variable names for lsl and usl. If they are column names JMP gets very confused.

my_lsl = mysl["LSL"];
my_usl = mysl["USL"];

Regards,
Peter
mpb

Super User

Joined:

Jun 23, 2011

What do you get when you insert show(col1, mysl) after the mysl = line? You should get something like this in the log:

col1:Column("Weight")
mysl:{LSL(65), USL(80)}
@Peter:

That worked. It's weird that JMP does not differentiate between upper case and lower case variables.

@mpb:
I was getting exactly what you showed in the log window which is why I was puzzled how the next limit extraction statement would not work.
Ok on the same lines, I get another error when the lsl or the usl is missing from the column. How can I handle this? I am ignoring the columns with missing lsl or usl with the Is missing statement:

ms

Super User

Joined:

Jun 23, 2011

You must insert the conditional tests before the assignments to avoid addressing a non-existent name. Try something like this...

I tried that and I am getting an error N Items() argument must be a list. Is the col1 variable a list only when there is a valid limit maybe?
mpb

Super User

Joined:

Jun 23, 2011

Yes. Use the function is list() to check if you have any limits associated with the column being processed.