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.
Choose Language Hide Translation Bar
RA899
Level IV

Concatenate a string to an integer.

Hi. 

I'm trying to create new columns with the same name, but different extension.

 

For example, I'm trying to create column 1 & column 2 &column 3... etc. 

 

Here is what I have: 

 

lista = list(1 , 2, 3 , 4); 



for(i1=1, i1<N Items ( lista)+1, i1++,
 dt_limit << new column (    insert( "condition", char ( lista(i1) )  )    );

);

 

 

it doesn't seem to work, however. It either returns an error or return something like this: " condition (1, 2, 3, 4) " or: "conditionlista"

 

Any guidance is appreciated. 

2 ACCEPTED SOLUTIONS

Accepted Solutions
RA899
Level IV

Re: Concatenate a string to an integer.

I realized I was using () instead of [] for calling the list index. It looks like its working now. 

View solution in original post

txnelson
Super User

Re: Concatenate a string to an integer.

Here are a couple of ways that I typically use

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For( i1 = 1, i1 < N Items( lista ) + 1, i1++,
	dt_limit << New Column( "condition" || " " || Char( lista( i1 ) ) );
);

or

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For each( {member}, lista,
	dt_limit << New Column( "condition" || " " || Char( member ) ) );
);
Jim

View solution in original post

2 REPLIES 2
RA899
Level IV

Re: Concatenate a string to an integer.

I realized I was using () instead of [] for calling the list index. It looks like its working now. 

txnelson
Super User

Re: Concatenate a string to an integer.

Here are a couple of ways that I typically use

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For( i1 = 1, i1 < N Items( lista ) + 1, i1++,
	dt_limit << New Column( "condition" || " " || Char( lista( i1 ) ) );
);

or

Names Default To Here( 1 );

lista = List( 1, 2, 3, 4 ); 

For each( {member}, lista,
	dt_limit << New Column( "condition" || " " || Char( member ) ) );
);
Jim

Recommended Articles