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
 How migrate scripts ".ogs" of Origin 7.5 to Origin

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
daholive_sjc Posted - 08/16/2011 : 1:32:46 PM
I have many scripts that worked in Origin 7.5 which now no longer work in Origin 8? I noticed that some syntax changed from one version to another. What is the suggestion for this kind of problem?

Operating System: Windows XP 64bit



Daniel H. Oliveira
8   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 08/24/2011 : 11:33:37 AM
Hi Daniel,

After putting break point in some line and calling the script, does the execution stop at that line? After it stops there, to proceed to next line etc. try using the shortcut keys (such as F8). If you were trying to use the toolbar buttons, those buttons do not work for LT debugging in some older versions.

Also, we could help better if you send some files to tech support and we can check. You can use the "Send File to Tech support" link on top of this page to do that.

Easwar
OriginLab
daholive_sjc Posted - 08/22/2011 : 07:55:27 AM
I'm sorry, I'm the novice user ORIGIN despite knowing a lot of programming language. The User who developed the scripts that I'm in trouble and left the company left for me to migrate to version 8. I'm not able to debug the code. I put the breakpoints where I want and execute the selected lines but nothing happens. What is the correct procedure to debug scripts ".ogs"?

Daniel H. Oliveira
greg Posted - 08/18/2011 : 3:43:11 PM
Your fragment does not show any problem.
I had to modify the code slightly to compensate for some copy paste issue, but this code works fine:
hfile = file.open(D:\test.txt);
cntg = 1;
type -q Please wait, reading header of data file!;
ret = file.lread(R,hfile);
ret = file.lread(K,hfile);
ret = file.lread(Q,hfile);
ret = file.lread(O,hfile);
ret = file.lread(U,hfile);
ret = file.lread(W,hfile);
ret = file.lread(D,hfile);
ret = file.lread(T,hfile);%T=;
XMin$(cntg) = %[%T,1:3];
YMin$(cntg) = %[%T,9:15];
ret = file.lread(T,hfile);%T=;
XMax$(cntg) = %[%T,1:7];
YMax$(cntg) = %[%T,9:15];
file.close();
XMIN1=;
YMIN1=;
XMAX1=;
YMAX1=;

You should try debugging in code builder to see if you can find what's really wrong.
daholive_sjc Posted - 08/18/2011 : 12:49:08 PM
Here's an example of my problem!

I have a script that reads a text file generated by Fortran and possesses the structure below:


CM X BETA XXX-XXX WIND TUNNEL TEST
TITLE 1
TITLE 2 Page 1
BETA
CM
0 0 0
1
0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000
96 1 0 f05fo1216.170
0.00000 0.24490
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000
0.00000 0.00000


I initialize some variables and then executes the next script
/* Mostra uma mensagem na Status Bar.*/

type -q Please wait, reading header of data file!;


/* Leitura da linha1 do arquivo - Titulo1, Relatório1.*/

ret = file.lread(R,hfile);


/* Leitura da linha2 do arquivo - Titulo2, Relatório2.*/

ret = file.lread(K,hfile);


/* Leitura da linha3 do arquivo - Titulo3, Relatório3.*/

ret = file.lread(Q,hfile);


/* Leitura da linha4 do arquivo - Titulo do eixo X.*/

ret = file.lread(O,hfile);

/* Leitura da linha5 do arquivo - Titulo do eixo Y.*/

ret = file.lread(U,hfile);


/* Leitura da linha6 do arquivo - Tipo da linha - Tipo da marca.*/

ret = file.lread(W,hfile);


/* Leitura da linha7 do arquivo - Nº de curvas, tipo do grafico.*/

ret = file.lread(D,hfile);

/* Leitura da linha8 do arquivo - Valores mínimo de X e Y.*/

ret = file.lread(T,hfile);

XMin$(cntg) = %[%T,1:10];
YMin$(cntg) = %[%T,11:20];


/* Leitura da linha9 do arquivo - Valor máximos de X e Y.*/

ret = file.lread(T,hfile);

XMax$(cntg) = %[%T,1:10];
YMax$(cntg) = %[%T,11:20];


7.5 In this script works and not 8. And from what I saw there is not much different.




Daniel H. Oliveira
easwar Posted - 08/18/2011 : 10:25:24 AM
Hi Daniel,

What we did in the transition from 7.x to 8.x is to expand the language to add various features, such as supporting the new workbook structure with its expanded column header properties such as long name, units etc.

As Greg pointed out, the space between variable name and the $ character is a known issue that we have seen with other customers, and this is documented in our release notes:
http://wiki.originlab.com/~originla/wiki/index.php?title=ReleaseNotes:Features_that_were_changed#LabTalk

Other than that we don't have a list of compatibility issues to report.

We suggest that:
1> you debug your code to see where it breaks
2> send us your code file and any relevant data, or at least the lines of code around where the issue occurs

To send files, please use the "Send File to Tech support" link on the top right of this page, and please refer to this forum post in your message.

Easwar
OriginLab
daholive_sjc Posted - 08/18/2011 : 06:08:08 AM
Is there a table or list of commands that tell what has changed from one version to another? For us who work in an engineering environment is very worrying that a graphical analysis software change much from one version to another. This prevents the sustainability of a production process which uses this tool. I hope that in future releases as many commands is not changed to justify the work I'll have to rewrite more than 5000 lines of code made #8203;#8203;in version 7.5.


Daniel H. Oliveira
Hideo Fujii Posted - 08/17/2011 : 3:46:34 PM
Another 'gotcha' issue (in Greg's term) is that if your script was assuming that created worksheets are named "Data1", "Data2",... , then obviously it doesn't work in the multiple worksheet environment because the window names are "Book1", "Book2",...

--Hideo Fujii
OriginLab
greg Posted - 08/17/2011 : 1:36:32 PM
The old syntax should work as well, but there may be some small differences. Scripts designed to work in the old one sheet per worksheet window may not work in an environment where you can now have multiple sheets in a workbook window. Use Code Builder to debug and step through your code to identify the problem.

One 'gotcha' is that string assignment no longer supports space between variable name and '$'.
This used to work
str $= "Hello"
but now you must use
str$= "Hello"
or
str$ = "Hello"

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