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
 avoid ending script caused by bad .dat import

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
Loick Posted - 03/30/2009 : 08:09:00 AM
Origin Ver. and Service Release (Select Help-->About Origin): 7.5
Operating System: XP

Hello,

I would like to know how I can avoid that my script end when importing bad .dat file?

I have the .dat file but it is not complete, no measured data in it (just header). When I try to import the data, I get this error : "file can not be read" and my script ends at this point.

So I want to create the worksheet even if there is nothing in it.

Is there any solution?

thanks for your help

Loick



If you don't understand why your Labtalk code is not working... Check your syntax -.-'
2   L A T E S T    R E P L I E S    (Newest First)
Loick Posted - 04/03/2009 : 03:30:09 AM
Hi Laurie,

Thanks for your help, it works "properly" now

I've sequenced my code in different parts.

Regards,

Loick
Laurie Posted - 03/30/2009 : 11:04:48 AM
Hi Loick,

The solution is to create a script file with sections of code. If your import code is in one section called from another, that section of code will stop running, but it will return to the section that called it and then the remaining script will continue running.

For example, create a LabTalk script file (OGS) with at least two sections of code:

[main]
   if(run.section(,import) == 0)
	type -b "File import was successful";
   else
	type -b "File failed to import";

   type -b "Regardless of success or failure of file import, I will see this message";

   return 0;


[import]
 open -w %B%A; 
 return 0;


Laurie

OriginLab Technical Support

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