View Single Post
  #2  
Old 11-17-2015, 11:16 AM
Friedly's Avatar
Friedly Friedly is offline
Registered User
 
Join Date: May 2012
Location: Belgium
Posts: 76
Re: load file defined

Hello Andrea,
have a look at this.

Code:
{ rem input in drafting the macro 
Macrostart:  
v macro      v Parameter
file_exists "path/filename" 

Global variable:  gv_file_existent
end rem }

DEFINE file_exists
  PARAMETER File_1
  LOCAL Default_file
  LET Default_file "path/default_filename" {* Change *}
  LET gv_file_existent 0
  TRAP_ERROR
    LOAD File_1
  IF (CHECK_ERROR)
    DISPLAY("File "+File_1+" not existent. Load Default File? Yes= any key | No= ESC ")
    LOAD Default_file
  ELSE
    LET gv_file_existent 1
  END_IF
END_DEFINE
Attached Files
File Type: m file_exists.m (524 Bytes, 394 views)

Last edited by Friedly; 11-20-2015 at 12:54 PM.
Reply With Quote