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
 Origin Forum
 Trap Execute error with Origin COM

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 - 12/13/2007 : 10:56:23 AM
Origin Version (Select Help-->About Origin): 7.5 SR6
Operating System: Win 2000

Hi,

Using a .NET application that launches Origin I would like to be able to trap when the code I wish to run via eg myOBj.Execute doesn't work.

For this example I wish to have the application trap when I run myObj.Execute(PeteCode.ogs, PeteSection) but the file or section doesn't exist.

Any ideas?

Thanks,

Cheers,

pete

6   L A T E S T    R E P L I E S    (Newest First)
peter.cook Posted - 12/19/2007 : 09:14:59 AM
Hi CP.

Thanks,

This is of course better coding.

Cheers,

pete

cpyang Posted - 12/19/2007 : 07:51:00 AM
I just tried in LT and if ogs filename or its section not found, a missing value is returned. So testing for !=0 should be good enough, but to ensure proper interpretation of missing value back to VB, maybe

CheckScript=run.section(filename1,section1);
if(CheckScript ==0/0) CheckScript=-1;

such that
0 = success
1 = LT error
-1 = not found


CP




peter.cook Posted - 12/19/2007 : 03:32:56 AM
Hi Easwar,

Thanks.

Can you pleasae confirm if my code will do the job correctly, for now?

Cheers,

Pete

easwar Posted - 12/18/2007 : 12:40:01 PM
Hi Pete,

This capability does not exist currently and a tracker item has been added to implement this in the future. Tracker number QA 10832

Thanks,

Easwar
OriginLab

peter.cook Posted - 12/18/2007 : 06:16:11 AM
Hi,

I'm not asking for the Execute function to return anything other than false. The problem is that it only appears to return TRUE whether or not the required code section / file exists.

myObj.Execute("run.section(filename.ogs,section)") will always return TRUE.

I assume this is because the run.section has worked. What I need is a way to trap if the section and / or file exists. I would have liked for example to have tried :

if myObj.Execute("run.section(filename1,section1)")="FALSE" then
myObj.Execute("run.section(filename2,section2)
end if

Is it enough / correct to do something like (VBA):

myObj.Execute("
CheckScript=run.section(filename1,section1);
if(CheckScript!=0) CheckScript=run.section(filename1,section1);
")
if myObj.ltvar("CheckScript")<>0 then
// trap script not found
end if

Regards,

pete

joseph_king Posted - 12/14/2007 : 03:17:16 AM
Hi Peter,

Could you give us the detail in your .Net application? Maybe we can supply more infomation. It can only get "true"(for success) or "false"(for failing) return value in Execute function. Do you want to catch the error code for different cases? We don't support this now.

OriginLab Technical Services

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