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
 Origin Forum
 problem with run.file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

vistec

Posts

Posted - 03/23/2006 :  10:03:01 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version: 7.5 SR4
Operating System: Win XP

Hello All,

I want to execute an entire Labtalkscriptfile for example:

R:\Project\Vorlagen\Labtalk_files\test.ogs

from the custom.ogs file.

My code is:

run.file(R:\Project\Vorlagen\Labtalk_files\test.ogs);

The test.ogs contains only a few lines:

[Main]
type " Hallo";
run.section(custom.ogs,S2);
run.section(custom.ogs,S1);
type "Ende";
[S1]
type "S1";
return;
[S2]
type "S2";
return;

Please, could anyone tell me what's wrong in this code?

Thanks

Hideo Fujii

USA
1582 Posts

Posted - 03/23/2006 :  10:14:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi vistec,

I have noticed two things:

1) You are running test.ogs, and probably want to call S2 and S1 sections inside the test.ogs . However, your run.section specifies to call custum.ogs . If in the same .ogs file, you can simply call like: run.section(,S2);

2) You don't need "return;" at the end of the section.

Hope this helps.

--Hideo Fujii
OriginLab

Go to Top of Page

easwar

USA
1965 Posts

Posted - 03/23/2006 :  10:34:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi vistec,

Hideo pointed out error above with custom.ogs being used instead of the test.ogs, and also no need to specify name of file if same file.

Also note that if you have sections in your ogs file, you cannot call them with run.file. You need to use run.section. Furthermore, you need to specify in run.section command to call [main]. The code under [main] is currently not called automatically unless specified.

So, for example, if your test.ogs file is as below:


type hi there!;
[Main]
type " Hallo";
run.section(,S2);
run.section(,S1);
type "Ende";
[S1]
type "S1";
return;
[S2]
type "S2";

return;



Then if you use the command:
run.file(R:\Project\Vorlagen\Labtalk_files\test.ogs)
you will get the output:
hi there!

If you use the command:
run.section(R:\Project\Vorlagen\Labtalk_files\test.ogs)
you will get the same output:
hi there!

But if you use the command:
run.section(R:\Project\Vorlagen\Labtalk_files\test.ogs, main)
you will get the output
Hallo
S2
S1
Ende

Easwar
OriginLab



Edited by - easwar on 03/23/2006 11:24:10 AM
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