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
 Worksheet Scripts

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
watec Posted - 03/13/2002 : 10:50:33 AM
Why in a worksheet scripts brackets have to be like this ?:
if (py>0) {
ry=dy/py+0.05;
}
else {
ry=dy+0.05;
}
In all other scripts the more debug friendly version:
if (py>0)
{
ry=dy/py+0.05;
}
else
{
ry=dy+0.05;
}
works fine.
3   L A T E S T    R E P L I E S    (Newest First)
watec Posted - 03/14/2002 : 05:23:55 AM
Thanks
Yes, I used the dialog obtained when selecting Tools : Worksheet Script.
Now I know, that this dialog employs a simplified interface.
So I think in this case it is better to stay with OGS files.
cpyang Posted - 03/13/2002 : 12:37:22 PM
The problem will exist in the Worksheet Script dialog, which is a dialog that we recommand not putting actual codes into. This dialog employed a simplified interface to allow script writing that does not require a terminating ';', similar to an CNF file. If you want real LabTalk, you should put that script into a OGS file and in that worksheet script dialog, put a single line

run.section(myScriptFile,MySection)

In CNF files and in worksheet script dialog, this simplified interface assumes all script to be single line, and thus the there is no need for terminating ';', then the interpreter will need the open '{' to know that your script is multi-lined.


CP




rtoomey Posted - 03/13/2002 : 11:57:56 AM
Could you tell me which version you tried this in? I tried it in Origin 6.1 SR4 (v.6.113) and experienced the problem in a slightly different manner. If I enter something like:

if (condition) {
// when condition is met (i.e. true), execute any script in here
}
else {
// when condition is not met, execute any script in here
}


the script would work when the condition was met, but wouldn't when it wasn't. However, if I entered:

if (condition) {
// when condition is met (i.e. true), execute any script in here
}
else
{
// when condition is not met, execute any script in here
}


the script would execute fine for both a true or false result. What this suggested is the placement of brackets for the if didn't matter, while the placement of the brackets in the else did.

Also, it would be helpful if you described the context of your situation and the steps you took which led to the problem. For instance, are you referring to the dialog obtained when selecting Tools : Worksheet Script? Or is it a different dialog? It would be great if you could clarify this.

- rtoomey


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