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
 Do script comments make Origin crash?

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
Jose Posted - 03/23/2000 : 8:36:00 PM
I find several difficulties when writing scripts. Sometimes Origin crashes when I run one, usually due to some minor error that I promptly detect. But one that I don't understand at all is related with comments. In one of my scripts, for example, the following line, right after a getnumber, goes fine


nump=nump-1;

but this other hangs the program


nump=nump-1; //En realidad no son puntos, sino intervalos

The error message I receive is in Spanish, since thus is my Windows, but says something like "This program has done an invalid operation..." for two times, and Origin crashes. Just due to the comment!

It may be some stupid error that I don't detect but... isn't it too drastic that a simple (hypothetical) syntax error can crash the program?

This may be not enough information. I am running Origin 6.0 Patch 1. I've tried this at least in two different PC with Win98. If you want to download my script (1.8 kB) and take a look at it, you will see that it only works fine if you delete any of the lines that I mark with (*). You just need to delete one line to make it work, any of them, but I can not see any error there! All brackets are properly closed, all lines end with semicolon... as far as I can see. Anyway, it could be some error of this kind, but to get a program crash as a result seems too drastic.

Run my script with run.section(test.ogs,s).

Any tip?

Jose.

[This message has been edited by Jose (edited 03-24-2000).]

5   L A T E S T    R E P L I E S    (Newest First)
grahamc Posted - 03/24/2000 : 8:35:00 PM
I concur- there should be more checking in scripts to reduce the number of illegal accesses and program crashes.

The usual reponse to a message like this is that no checking is implimented for reasons of speed. However, it's quite trivial to write a simple parser that scans the script and checks for simple errors like unmatched brackets, too many characters between brackets, missing semicolons etc- indeed quite a while ago I added the functionality to my routine that sends Origin scripts from other programs.

Such an approach can't check for more sophisticated crash bugs- such as deleting a dataset and then trying to perform an operation on it- but it would wipe out a significant number for very little work and lost time.

Mike Buess Posted - 03/23/2000 : 12:53:00 PM
Jose,

I downloaded the script and it did crash Origin as advertised. However, the first line contains an unmatched bracket "{" and removing it seems to solve the problem.

Mike

Jose Posted - 03/23/2000 : 1:59:00 PM
Ho ho, that makes sense, thank you very much. I now understand that apparently weird behavior.

In any case, it is not the first time that I find a limitation like this in Origin that causes the program to crash... Shouldn't it have a check up procedure or something to avoid such drastic response? At least the manuals could have an easy-to-find list of this "dramatic" limitations to definitely avoid them. Otherwise I would have to read all the manual in detail to understand what happens. It may be that I like ready-to-use products, I seldom read manuals...

Thank you very much.

jose.

[This message has been edited by Jose (edited 03-23-2000).]

greg Posted - 03/23/2000 : 1:42:00 PM
You should review the Knowledge Base item on http://www.microcal.com/www/tech/resultstech.asp?ItemID=280&VersionID=6.0&TitleID=The+Maximum+Number+of+Characters+Between+a+Set+of+{+}&CatID=LabTalk+Scripting&TypeID=Limitation"> The Maximum Number of Characters Between a Set of { }.

You are correct that the curly braces are correctly matched, but removing the first curly brace (as Mr. Buess suggested) appears to fix the problem because the character limitation was thereby avoided. The lines you note as problems are not problems explicitly because of their syntax, rather they are problems because of where they occur in the internal script tokenization process.

Obviously you still want the conditional to apply which led to your use of the braces in the first place. The solution is to break up the code within the first set of braces. You could do this with macros or using run.section( ) and removing some of your code to new sections (this also makes documentation of your code clearer which makes maintaining your code easier).

If you are completely satisfied with the code as-is, then a quick-and-dirty fix is to remove all comments which should bring you under the token limit.
Jose Posted - 03/23/2000 : 1:06:00 PM
It may magically solve the problem but the curly bracket is not unmatched. Its correspondant closing one is before the last else, at the end of the script. All the main part of the script is the affirmative case of the very first if, so the curly bracket opens at the first line and closes near the end...

j.


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