Subscribe Bookmark RSS Feed

Changes to indexing or concat from JMP10 to JMP11?

chfields

Community Trekker

Joined:

Apr 2, 2013

I had a perfectly good working script to open all the files in a directory and then Concatenate all of the files (in JMP10).

I use this and variants of this script all the time for data collection.

Now in JMP11 is crashes on the Concatenate part of the script.

It still works fine in JMP10 and so I am back to using JMP10 for my work.

This group helped me get the first script going back in April of this year.

Please help!!

Charlie Fields

=====================================================================================================

path = "C:\temp\data\";

final_files = {};

final_files = Files in Directory(path, recursive);

 

///////////////////Open First File in List/////////////////////

///////additional files will be appended to this one///////////

i=1;

dtjoin = Open(

     path || final_files

                  )

        << set name( "Joined1" );

////////////////////////////////////////////////////////////////////////////

//////////Now open the remaining Files in List//////////////

////////////////////////////////////////////////////////////////////////////

i=2;

For( i = 2, i <= N Items( final_files ), i++,

    dt =

        Open(

            path || final_files,

        );

    dtjoin = dtjoin << Concatenate(

          dt,

          output table name( "Joined" || Char( i ) ),

        );

    Close( dt, nosave);

    Close( "Joined" || Char( i - 1 ), nosave );

             

); //End of For

dtjoin << set name( "All Joined" );

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Seems like JMP 11 is less forgiving when it comes to code that is ambiguous about the evaluation order. Your code does not crash JMP 11 for me but gives the error "Send Expects Scriptable Object in access or evaluation of 'Send' , dtjoin << Concatenate( dt, output table name( "Joined" || Char( i ) ) )" in the log.

Try to be more explicite in the section "Open First File in List". To be certain that the variable dtjoin is referring to a data table (and not a string), either enclose the assignment within parentheses to force evaluation before renaming of the table,

(dtjoin = Open( path || final_files[i] )) << set name( "Joined1" );

       

or separate the assignment and renaming into two statements:

dtjoin = Open( path || final_files[i] );

dtjoin << set name( "Joined1" );

2 REPLIES
Solution

Seems like JMP 11 is less forgiving when it comes to code that is ambiguous about the evaluation order. Your code does not crash JMP 11 for me but gives the error "Send Expects Scriptable Object in access or evaluation of 'Send' , dtjoin << Concatenate( dt, output table name( "Joined" || Char( i ) ) )" in the log.

Try to be more explicite in the section "Open First File in List". To be certain that the variable dtjoin is referring to a data table (and not a string), either enclose the assignment within parentheses to force evaluation before renaming of the table,

(dtjoin = Open( path || final_files[i] )) << set name( "Joined1" );

       

or separate the assignment and renaming into two statements:

dtjoin = Open( path || final_files[i] );

dtjoin << set name( "Joined1" );

chfields

Community Trekker

Joined:

Apr 2, 2013

Thanks a million!

I used this one:

dtjoin = Open( path || final_files[i] );

dtjoin << set name( "Joined1" );


as you suggested and it worked great.


Now I will have to implement this change in my other code.

Also now, I can continue using JMP11.


Thanks again!!

Charlie