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
 Origin Forum
 if then loop compiling error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

GiuliaF

2 Posts

Posted - 03/29/2012 :  04:42:49 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.1 and if then loop;
Operating System: Windows

Hallo i am newy in origin, i am trying to elaborate some data:
i want to corrected some radiance temperature with emissivity values,
i have got 2 formula one if solid T>1630K one if liquid; and i am using if then loop
is this ok?? it gives me a compiling erro on declaration variables!!

// Declare ranges for columns A and B
range ra = col(C);
range rb = col(B);
// Fix the test value "Melting Radiance Temperature"
vtest = 1630;
// if then loop
loop(row,1,ra.GetSize())
{
if(ra[row] > vtest) rb[row] = 1/(1/ra[row]+0.65856/14388.6*ln(0.333+8.275E-6*ra[row]);
else rb[row] = 1/(1/ra[row]+0.65856/14388.6*ln(0.48727-1.97327E-5*ra[row]);
}

Best Regards
Fidelma

Hideo Fujii

USA
1582 Posts

Posted - 03/29/2012 :  09:22:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Fidelma,

It seems the following two lines don't have the matching parenthesis ')':

1/(1/ra[row]+0.65856/14388.6*ln(0.333+8.275E-6*ra[row]);

and

1/(1/ra[row]+0.65856/14388.6*ln(0.48727-1.97327E-5*ra[row]);

--Hideo Fujii
OriginLab
Go to Top of Page

GiuliaF

2 Posts

Posted - 03/30/2012 :  02:56:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much
i have correct it this way :


range ra = col(C);
range rb = col(B);
// Fix the test value "Melting Radiance Temperature"
vtest = 1630;
// if then loop
loop(row,1,ra.GetSize())
{
if(ra[row] > vtest) rb[row] = 1/(1/ra[row]+0.65856/14388.6*ln(0.333+8.275E-6*ra[row]));
else rb[row] = 1/(1/ra[row]+0.65856/14388.6*ln(0.48727-1.97327E-5*ra[row]));
}

But it is giving me the same this error:

Error, syntax error in variable declaration.

Compiling errors found, linking cannot start!

The error is signed on the line of( range ra=....)



quote:
Originally posted by Hideo Fujii

Hi Fidelma,

It seems the following two lines don't have the matching parenthesis ')':

1/(1/ra[row]+0.65856/14388.6*ln(0.333+8.275E-6*ra[row]);

and

1/(1/ra[row]+0.65856/14388.6*ln(0.48727-1.97327E-5*ra[row]);

--Hideo Fujii
OriginLab

Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 03/30/2012 :  09:45:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Fidelma,

Your code is of LabTalk script, so you don't need to compile, and you can run as is given by the LabTalk interpreter. You can copy-and-paste to the Script window("Window: Script Window" menu), highlight all lines, and press ENTER key to run; Or you can put your script in a script file(.OGS), and run by various way. Please consult to the following page (or its counterpart in the LabTalk help) for the details:

http://wiki.originlab.com/~originla/ltwiki/index.php?title=Category:LT_Running_Scripts

Hope this makes sense.

--Hideo Fujii
OriginLab
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