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 for Programming
 Forum for Origin C
 negative values
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Maria82

1 Posts

Posted - 05/24/2010 :  07:18:37 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi there, I'm trying to run this script

for(col = 1; col <= 10;col ++)
{
Book2_B$(col) = Book2_B$(col)/Book2_A(col);
}

The problem I have is that when values in column A are negative the script does not work, could anyone help me?

Thank you

Penn

China
644 Posts

Posted - 05/24/2010 :  11:32:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am not sure which version of Origin you are using. I have tried your script in Origin 7.5, Origin 8 SR6 and Origin 8.1 SR3, and it works fine. I have added one more script to output the values in column A for debugging, you can also have a try:

for(col=1; col<=10; col++)
{
    Book2_A(col)=;
    Book2_B$(col) = Book2_B$(col)/Book2_A(col);
}

By the way, if you are using Origin 8 or Origin 8.1, you can try the following script.

// suppose your data in Sheet1 of Book2
range rColA = [Book2]Sheet1!col(a);
for(ii = 1; ii<=10; ii++)
{
    range rCol = [Book2]Sheet1!col(B$(ii));
    rCol = rCol/rColA[ii];
}


Penn

Edited by - Penn on 05/24/2010 11:33:32 PM
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