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
 run .ogs files containing the command for

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
Aure Posted - 08/11/2004 : 12:37:02 PM
Original question:

Typing the following commands in the script window:
for (ii = 1; ii <= 4;ii ++)
{
type "ii = $(ii)";
};
and highlighting all lines and clicking enter produces the output:
ii = 1
ii = 2
ii = 3
ii = 4

But placing the same commands in a file called test.ogs and issuing the command:
run test.ogs
produces the following (different) output:
ii=5

Answer:--------------------

Hi,

Use the command:
run.section(test.ogs)
instead.

If you then place the code under a section in the OGS file, such as:

[mysection]
for (ii = 1; ii <= 4;ii ++)
{
type "ii = $(ii)";
};
[someothersection]



then you can use the command
run.section(test.ogs,mysection)

Easwar
OriginLab

P.S. I altered the text of your original post by mistake. My apologies.
1   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 08/11/2004 : 4:52:52 PM
Hi,

In the "Run" command section in LabTalk Help, there is a description:
  ...The run command executes on a line-by-line basis.
Multi-line structures must include the line continuation character "{" ...

So, in your case, merging "{" in the the second with the
first line will solve the problem. That is:
  for (ii = 1; ii <= 4;ii ++) {
  type "ii = $(ii)";
  };
From the Script window, you forced to execute all lines
by highlighting.

Hideo
OriginLab



Edited by - Hideo Fujii on 08/11/2004 4:56:12 PM

Edited by - Hideo Fujii on 08/11/2004 4:57:21 PM

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