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
 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:06:13 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 a lot



Edited by - vistec on 03/23/2006 10:07:41 AM

greg

USA
1380 Posts

Posted - 03/23/2006 :  11:47:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The run.file( ) method begins execution at the beginning of a file, but it respects [section] names in the sense that if it runs into a section name, then execution ends - just like the run.section( ) method.

So your code does nothing since it ends as soon as it hits [Main].

If you want to use run.file : don't put any [sections] in the file;
if you want to use [sections] : use the run.section( ) method.




Edited by - greg on 03/23/2006 11:47:45 AM
Go to Top of Page

vistec

Posts

Posted - 03/24/2006 :  02:15:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks greg for your help

Is there an opportunity to call a skriptfile for example
test.ogs from a skriptfile for example custom.ogs, when the called skriptfile test.ogs contains sections and when I want to call this section with run.section within this file, such as I tried in my code?
May be with:

run R:\PROJECT\Vorlagen\Labtalk_files\test.ogs ??

Thanks for your help
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/24/2006 :  08:11:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This will run the [Main] section of your test file...
run.section(R:\PROJECT\Vorlagen\Labtalk_files\test.ogs,Main);

Help > Programming > LabTalk Language Reference > Object Reference > Alphabetical Listing... > Run

Mike Buess
Origin WebRing Member
Go to Top of Page

vistec

Posts

Posted - 03/27/2006 :  05:56:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot for your help Mike
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