The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Save file with identical name - append version

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
peter.cook Posted - 05/28/2004 : 08:50:32 AM
HI,

I want to save all graphs created within an origin application via LabTalk and C to a single folder. However, many will have identical default names.

One approach is to see if a file of that name exists and if so append eg v2, v3 to the file name. Okay, no problem.

I was wondering if it might be quicker to trap this as an error when saving then trying with eg v2,v3 appended to the file name. If so, how could this be done.



NB This would be over a network.

Cheers,

pete

2   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 05/28/2004 : 12:17:12 PM
Hi MIke,

Nice (simple) idea - I'll look into it.

cheers,

Pete

Mike Buess Posted - 05/28/2004 : 11:12:03 AM
Hi Pete,

Not sure how about the best way to incorporate this into error handling or about the implications of network paths, but an easy way to deal with duplicate file names is with get_next_file_name().

Global Functions->File Management

bool get_next_file_name(string& strFilename, bool bCheckCreatePath = true)

Example:

string str = GetAppPath() + "origin.ini";
get_next_file_name(str);
out_str(str);

>>C:\Origin75\User\origin1.ini

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000