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
 Testing for X-Function Existance

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
cdrozdowski111 Posted - 07/25/2013 : 07:21:30 AM
OriginPro 9.0.0 SR2 64-bit, Win7 64-bit, running in VMware Fusion 5.0.3


Let's say I have developed a LT script in Origin 9 but want it to be able to run the script in an earlier version of Origin. How can I test if a given X-Function exists in the earlier version?

For example, the "insert_graph_to_layer" X-Function was introduced in 9. What can I add to my script to make the script not stumble in Origin 8.x?

What would be the most elegant/classy way too?
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 07/25/2013 : 11:33:00 AM
Script within braces runs in a new context - the same as script running in a called OGS. Errors within these new contexts do not stop a script (or even output an error message) they simply return.

You can use this information in the following way:

flag = 0;
{
insert_graph_to_layer;
flag = 1; // If an error occurs, this never runs
}
if(flag == 1)
continue; // No problem
else
{
ty -a An Error has occurred.;
// Uncomment following line to stop script completely
// break;
// or execute error handling which lets script continue
// your handling here
}
ty -a Continuing ...;

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