cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
B1234
Level III

JMP Crashing

I wrote a script where if a folder does not exist, then a folder will be created. The path is to a shared network folder. I have modify access to the shared folder and the script works fine for me. However, when a colleague who has only read access to the shared folder, runs the script JMP crashes when it get to the below section of code. JMP just completely closes everything, even the log file so I can't see if there is an error with it. And it works fine for me. 

Wondering why this is happening ?

 

 

datestamper = Long Date( Today() );
timestamp = MDYHMS( Today() );
dtname = New Table( "UserName",
    add rows( 1 ),
    New Column( "Time", Character, "nominal", set each value( timestamp ) )
);
dtname:Time << set data type( Numeric ) << Format( ("ddmonyyyy h:m:s"), Input Format( "mm/dd/yyyy h:m:s" ) );
dtname:Time << set data type( Character );
dtname << New Column( "Folder", Character, nominal, formula( Substr( :Time, 3, 7 ) ) );
foldername = Char( :Folder );

path = ("S:\Lab\JMP\Results\Data\" || Char( foldername ) || "\");

If( !Directory Exists( path ),
    Create Directory( path ),
    Print( path || " already exists." );
    Wait( 0 );
);


 
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: JMP Crashing

I'd use a script like this to narrow down the problem:

// Create a log file on disk. Append each line to the end.

_LogFileName = "$desktop/JMP_log_file.txt";
// clear any old data and make sure the file exixts:
Save Text File( _LogFileName, Format( Today(), "h:m:s" ) || " starting\!n", Mode( "replace" ) );

addLog = Function( {txt},
	Save Text File( _LogFileName, Format( Today(), "h:m:s" ) || " " || Char( txt ) || "\!n", Mode( "append" ) )
);

// example:

addlog( "begin loop" );
For( i = 1, i < 3, i += 1,
	addlog( "looping " || Char( i ) )
);
addlog( "done" );

Open( _LogFileName, "script" ); // open in a script editor

After the crash, the file (on the desktop in this example) will show the last call to addlog on the last line of the file. After a couple of tries, you can probably narrow the problem down to a single statement. I'll guess it will be related to the network drive; be sure to add the filenames and such to the log file. Use char() to convert non-text values to text.

 

JMP should not be crashing; even if you figure out a work-around if would be great to report the problem to tech support, thanks!

 

edit 1: I'd be particularly suspicious of the S: drive map not being the same on both computers. Using a UNC name might be a workaround if that is the problem (\\server\path\file).

 

edit 2: I think there may be an issue with the formula column or the current row in the table as well. Something like this (untested) might be better:

datestamper = Long Date( Today() );
timestamp = MDYHMS( Today() );
dtname = New Table( "UserName",
    add rows( 1 ),
    New Column( "Time", Character, "nominal", set each value( timestamp ) )
);
dtname:Time << set data type( Numeric ) << Format( ("ddmonyyyy h:m:s"), Input Format( "mm/dd/yyyy h:m:s" ) );
dtname:Time << set data type( Character );
dtname << New Column( "Folder", Character, nominal, formula( Substr( :Time, 3, 7 ) ) );
dtname << runFormulas; // force the formulas to run now
foldername = Char( dtname:Folder[1] ); // explicit table and row subscript

path = ("S:\Lab\JMP\Results\Data\" || Char( foldername ) || "\");
Craige

View solution in original post

2 REPLIES 2
Craige_Hales
Super User

Re: JMP Crashing

I'd use a script like this to narrow down the problem:

// Create a log file on disk. Append each line to the end.

_LogFileName = "$desktop/JMP_log_file.txt";
// clear any old data and make sure the file exixts:
Save Text File( _LogFileName, Format( Today(), "h:m:s" ) || " starting\!n", Mode( "replace" ) );

addLog = Function( {txt},
	Save Text File( _LogFileName, Format( Today(), "h:m:s" ) || " " || Char( txt ) || "\!n", Mode( "append" ) )
);

// example:

addlog( "begin loop" );
For( i = 1, i < 3, i += 1,
	addlog( "looping " || Char( i ) )
);
addlog( "done" );

Open( _LogFileName, "script" ); // open in a script editor

After the crash, the file (on the desktop in this example) will show the last call to addlog on the last line of the file. After a couple of tries, you can probably narrow the problem down to a single statement. I'll guess it will be related to the network drive; be sure to add the filenames and such to the log file. Use char() to convert non-text values to text.

 

JMP should not be crashing; even if you figure out a work-around if would be great to report the problem to tech support, thanks!

 

edit 1: I'd be particularly suspicious of the S: drive map not being the same on both computers. Using a UNC name might be a workaround if that is the problem (\\server\path\file).

 

edit 2: I think there may be an issue with the formula column or the current row in the table as well. Something like this (untested) might be better:

datestamper = Long Date( Today() );
timestamp = MDYHMS( Today() );
dtname = New Table( "UserName",
    add rows( 1 ),
    New Column( "Time", Character, "nominal", set each value( timestamp ) )
);
dtname:Time << set data type( Numeric ) << Format( ("ddmonyyyy h:m:s"), Input Format( "mm/dd/yyyy h:m:s" ) );
dtname:Time << set data type( Character );
dtname << New Column( "Folder", Character, nominal, formula( Substr( :Time, 3, 7 ) ) );
dtname << runFormulas; // force the formulas to run now
foldername = Char( dtname:Folder[1] ); // explicit table and row subscript

path = ("S:\Lab\JMP\Results\Data\" || Char( foldername ) || "\");
Craige
B1234
Level III

Re: JMP Crashing

Thanks Craig, you were correct with the edit 1 (\\server\path\file). Once I mapped the server rather than s: it worked perfectly. thanks a million for your help