CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Drafting

Thread Tools Search this Thread Rate Thread Display Modes
Old 11-17-2015, 01:33 AM
andrea andrea is offline
Registered User
Join Date: Sep 2003
Location: italy
Posts: 260
load file defined

how can I build a macro that loading if I do not find a file (with a specific name) , I load a default ???
Reply With Quote
Old 11-17-2015, 11:16 AM
Friedly's Avatar
Friedly Friedly is offline
Registered User
Join Date: May 2012
Location: Belgium
Posts: 73
Re: load file defined

Hello Andrea,
have a look at this.

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

Global variable:  gv_file_existent
end rem }

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

Last edited by Friedly; 11-20-2015 at 12:54 PM.
Reply With Quote
Old 11-25-2015, 10:24 PM
ludw ludw is offline
Registered User
Join Date: Dec 2006
Location: France
Posts: 83
Re: load file defined

You may also consider SEARCH command. With SEARCH you may enter different directories from where the LOAD command will try to find out and load the file to LOAD.
Ex: LOAD "myfile"
will try to locate and load "myfile" in each ordered directories specified by SEARCH.
To know about your SEARCH settings, let use EDIT_ENVIRONMENT.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 09:27 AM.

Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.