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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Return value for IF statement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

wallacej

UK
Posts

Posted - 04/14/2005 :  12:09:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (7.5):
Operating System:Win2k

Hi

I have the following line of lab talk script:
 document -a C:\Program Files\OriginLab\OriginPro75\Origin.otp


If the above line fails I would like to call it again with a different path (Origin75 not OriginPro75).

What would the line return if it was successful (or fails) so I can create an IF statement.

Thank You

Mike Buess

USA
3037 Posts

Posted - 04/14/2005 :  12:51:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The document command returns nothing but you can test for the existence of the project with the exist(file path\name) function. If the file exists the function returns its size in KB, if it doesn't exist it returns -1.

%Z=C:\Program Files\OriginLab\OriginPro75\Origin.otp;
if( exist(%Z)<0 )
{
%Z=some other file;
if( exist(%Z)<0 ) %Z="";
};
if(%Z!="") doc -a %Z;

Mike Buess
Origin WebRing Member
Go to Top of Page

wallacej

UK
Posts

Posted - 04/15/2005 :  05:31:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike

That worked perfectly

Jamie
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000