cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-44600%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Eerreur%26nbsp%3B%3A%20le%20num%C3%A9ro%20de%20ligne%20(-1)%20n'est%20pas%20valide.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44600%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%2C%3C%2FP%3E%3CP%3EJe%20suis%20le%20tout%20premier%20exemple%20sur%20%22hello%20world%22%20dans%20les%20scripts%20JMP%20basic%20et%20j'ai%20rencontr%C3%A9%20une%20erreur.%3C%2FP%3E%3CP%3Esc%C3%A9nario%3A%3C%2FP%3E%3CP%3Epour(i%3D1%2C%20i%26lt%3B5%2C%20i%2B%2B%2C%3CBR%20%2F%3E%20X%20%3D%20je%3B%3CBR%20%2F%3E%20A%3D%22Bonjour%20tout%20le%20monde%22%26nbsp%3B%3B%3CBR%20%2F%3E%20imprimer(X%2CA))%3B%3CBR%20%2F%3E%20print(%22fait%22)%3B%3C%2FP%3E%3CP%3Eerreur%3A%3C%2FP%3E%3CP%3EImpossible%20de%20d%C3%A9finir%20la%20valeur%20de%20la%20colonne%20%C2%AB%20X%20%C2%BB%20car%20le%20num%C3%A9ro%20de%20ligne%20(-1)%20n'est%20pas%20valide.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EQuelqu'un%20peut-il%20expliquer%20ce%20qui%20ne%20va%20pas%20avec%20le%20script%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-44604%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20erreur%26nbsp%3B%3A%20le%20num%C3%A9ro%20de%20ligne%20(-1)%20n'est%20pas%20valide.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44604%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ELe%20probl%C3%A8me%20est%20celui%20de%20la%20port%C3%A9e.%20JMP%20trouve%20votre%20variable%20'X%3A%20dans%20un%20tableau%20de%20donn%C3%A9es.....je%20suppose.%20Et%20%C3%A0%20cause%20de%20cela%2C%20il%20souhaite%20avoir%20un%20indice%20pour%20la%20variable%20X.%20Pour%20que%20cela%20fonctionne%20et%20pointez%20vers%20la%20variable%20m%C3%A9moire%20%22X%22%2C%20vous%20devez%20forcer%20la%20r%C3%A9f%C3%A9rence%20appropri%C3%A9e%20en%20pla%C3%A7ant%20%22%3A%3A%22%20devant%20la%20variable.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3EFor(%20i%20%3D%201%2C%20i%20%26lt%3B%205%2C%20i%2B%2B%2C%0A%20%3A%3AX%20%3D%20i%3B%0A%20A%20%3D%20%22Hello%2C%20World%22%3B%0A%20Print(%20%3A%3AX%2C%20A%20)%3B%0A)%3B%0APrint(%20%22done%22%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-44603%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20erreur%26nbsp%3B%3A%20le%20num%C3%A9ro%20de%20ligne%20(-1)%20n'est%20pas%20valide.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44603%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ESemble%20fonctionner%20bien..%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-44602%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20erreur%26nbsp%3B%3A%20le%20num%C3%A9ro%20de%20ligne%20(-1)%20n'est%20pas%20valide.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-44602%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20970px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20970px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20970px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F7591iA9769BA786E18A08%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
cdoraem
Level I

error: row number (-1) is not valid.

Hi,

I am following the very first example on "hello world' in JMP scripting basic and has encountered error.

script:

for(i=1, i<5, i++,
X=i;
A="Hello, World";
print(X,A));
print("done");

error:

Cannot set value for the column 'X' because the row number (-1) is not valid.

 

Can anyone enlighten what is wrong with the script?

2 ACCEPTED SOLUTIONS

Accepted Solutions
uday_guntupalli
Level VIII

Re: error: row number (-1) is not valid.

txnelson
Super User

Re: error: row number (-1) is not valid.

The issue is one of scoping.  JMP is finding your variable 'X: in a data table.....I assume.  And because of that, it is wanting to have a subscript for the X variable.  To make this work and point to the memory variable "X" you need to force the proper reference to it by placing "::" in front of the variable.

For( i = 1, i < 5, i++,
	::X = i;
	A = "Hello, World";
	Print( ::X, A );
);
Print( "done" );
Jim

View solution in original post

3 REPLIES 3
uday_guntupalli
Level VIII

Re: error: row number (-1) is not valid.

image.png

Best
Uday
uday_guntupalli
Level VIII

Re: error: row number (-1) is not valid.

Seems to run fine ..
Best
Uday
txnelson
Super User

Re: error: row number (-1) is not valid.

The issue is one of scoping.  JMP is finding your variable 'X: in a data table.....I assume.  And because of that, it is wanting to have a subscript for the X variable.  To make this work and point to the memory variable "X" you need to force the proper reference to it by placing "::" in front of the variable.

For( i = 1, i < 5, i++,
	::X = i;
	A = "Hello, World";
	Print( ::X, A );
);
Print( "done" );
Jim

Recommended Articles