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
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