cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
NetflixCrow956
Level III

no save file

Hello everyone, my problem is that when I press the button "Annuler" (=Cancel), it still saves the file to me even though I don't want it, how can I do that?
I put you the attached script.
Thanks

 

NetflixCrow956_0-1648643389055.png

path_save = Pick Directory( "Où sauver les fichiers analyse rendement?" );

NAME = "_ANALYSE_RENDEMENT";
//////////////////////////////////////        DEFINE DIR AND FILE NAMES (MONTH / YEAR) + CREATE DIR              /////////////////////////////////////////////////////////
DAY_   = Day(Today());
MONTH_ = Month( Today() );
YEAR_ = Year( Today() );
HOUR_ = Hour(Today());
MINUTE_ = Minute(Today());
SECONDE_ = Second(Today());


If(MONTH_ < 10 , NAME_MONTH= "0" || Char(MONTH_), NAME_MONTH= Char(MONTH_) );
If(DAY_   < 10 , NAME_DAY= "0"   || Char(DAY_)  , NAME_DAY  = Char(DAY_)   );
NAME_TIME = "_" || Char(HOUR_) || "H" || Char(MINUTE_) || "M" || Char(SECONDE_) || "S";

//DIR_NAME = Char(MONTH_ )|| " - " || Word(1,NAME,"_") || "_" || Char( YEAR_ ) ;
DIR_NAME = Char( YEAR_ ) || NAME_MONTH || NAME_DAY || NAME_TIME || NAME;

If( Directory Exists( path_save || DIR_NAME ), ,	Create Directory( path_save || DIR_NAME ));

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: no save file

Adding check for empty path might be enough:

Names Default To Here(1);

path_save = Pick Directory( "Où sauver les fichiers analyse rendement?" );

If(path_save == "",
	Show("Cancel pressed");
	stop(); //or use throw()
);

NAME = "_ANALYSE_RENDEMENT";
//////////////////////////////////////        DEFINE DIR AND FILE NAMES (MONTH / YEAR) + CREATE DIR              /////////////////////////////////////////////////////////
DAY_   = Day(Today());
MONTH_ = Month( Today() );
YEAR_ = Year( Today() );
HOUR_ = Hour(Today());
MINUTE_ = Minute(Today());
SECONDE_ = Second(Today());


If(MONTH_ < 10 , NAME_MONTH= "0" || Char(MONTH_), NAME_MONTH= Char(MONTH_) );
If(DAY_   < 10 , NAME_DAY= "0"   || Char(DAY_)  , NAME_DAY  = Char(DAY_)   );
NAME_TIME = "_" || Char(HOUR_) || "H" || Char(MINUTE_) || "M" || Char(SECONDE_) || "S";

//DIR_NAME = Char(MONTH_ )|| " - " || Word(1,NAME,"_") || "_" || Char( YEAR_ ) ;
DIR_NAME = Char( YEAR_ ) || NAME_MONTH || NAME_DAY || NAME_TIME || NAME;

If( Directory Exists( path_save || DIR_NAME ), ,	Create Directory( path_save || DIR_NAME ));
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: no save file

Adding check for empty path might be enough:

Names Default To Here(1);

path_save = Pick Directory( "Où sauver les fichiers analyse rendement?" );

If(path_save == "",
	Show("Cancel pressed");
	stop(); //or use throw()
);

NAME = "_ANALYSE_RENDEMENT";
//////////////////////////////////////        DEFINE DIR AND FILE NAMES (MONTH / YEAR) + CREATE DIR              /////////////////////////////////////////////////////////
DAY_   = Day(Today());
MONTH_ = Month( Today() );
YEAR_ = Year( Today() );
HOUR_ = Hour(Today());
MINUTE_ = Minute(Today());
SECONDE_ = Second(Today());


If(MONTH_ < 10 , NAME_MONTH= "0" || Char(MONTH_), NAME_MONTH= Char(MONTH_) );
If(DAY_   < 10 , NAME_DAY= "0"   || Char(DAY_)  , NAME_DAY  = Char(DAY_)   );
NAME_TIME = "_" || Char(HOUR_) || "H" || Char(MINUTE_) || "M" || Char(SECONDE_) || "S";

//DIR_NAME = Char(MONTH_ )|| " - " || Word(1,NAME,"_") || "_" || Char( YEAR_ ) ;
DIR_NAME = Char( YEAR_ ) || NAME_MONTH || NAME_DAY || NAME_TIME || NAME;

If( Directory Exists( path_save || DIR_NAME ), ,	Create Directory( path_save || DIR_NAME ));
-Jarmo

Recommended Articles