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
 automatic worksheet size?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kubra

Slovakia
10 Posts

Posted - 08/04/2015 :  09:40:53 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System:WIN7

Hello.
I have a problem with somehow automatic size of created worksheet. Here is part of my code:

double HSat = 10000;
double deltaHa = 1000;
double deltaHb = 1000;
int nmbPoints = HSat/deltaHb;
int deltaPoints = deltaHa/deltaHb;

Worksheet newwks;
newwks.Create("new");
newwks.SetSize(2*nmbPoints+1,b+1);
newwks.Columns(0).SetLongName("H");
newwks.Columns(0).SetUnits("Oe");

Problem is... Worksheet is created, however, if the numberof rows in SetSize command is under 23, worksheet is automatically created with 29 rows (cols number b is calculated in separated loop and there is no problem with it). Redundant rows can´t be deleted neither automatically nor with code. Is it feature of language, Origin settings or code problem?

Thanks and have a nice day!

Castiel

343 Posts

Posted - 08/04/2015 :  10:53:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by kubra

Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System:WIN7

Hello.
I have a problem with somehow automatic size of created worksheet. Here is part of my code:

double HSat = 10000;
double deltaHa = 1000;
double deltaHb = 1000;
int nmbPoints = HSat/deltaHb;
int deltaPoints = deltaHa/deltaHb;

Worksheet newwks;
newwks.Create("new");
newwks.SetSize(2*nmbPoints+1,b+1);
newwks.Columns(0).SetLongName("H");
newwks.Columns(0).SetUnits("Oe");

Problem is... Worksheet is created, however, if the numberof rows in SetSize command is under 23, worksheet is automatically created with 29 rows (cols number b is calculated in separated loop and there is no problem with it). Redundant rows can´t be deleted neither automatically nor with code. Is it feature of language, Origin settings or code problem?

Thanks and have a nice day!




Your worksheet has enabled Auto Add Rows.
To disable it, you can use LabTalk script
wks.autoaddrows = 0
, or use okoc_create_workbook() instead.
See
1. http://www.originlab.com/doc/LabTalk/ref/Wks-obj
2. http://www.originlab.com/doc/OriginC/ref/okoc_create_workbook

c   ȥ  fuc  c    Τ  c/     
 cʥ       ' ̩   /  թf
                            `    
                              
Go to Top of Page

kubra

Slovakia
10 Posts

Posted - 08/04/2015 :  12:14:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Castiel

quote:
Originally posted by kubra

Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System:WIN7

Hello.
I have a problem with somehow automatic size of created worksheet. Here is part of my code:

double HSat = 10000;
double deltaHa = 1000;
double deltaHb = 1000;
int nmbPoints = HSat/deltaHb;
int deltaPoints = deltaHa/deltaHb;

Worksheet newwks;
newwks.Create("new");
newwks.SetSize(2*nmbPoints+1,b+1);
newwks.Columns(0).SetLongName("H");
newwks.Columns(0).SetUnits("Oe");

Problem is... Worksheet is created, however, if the numberof rows in SetSize command is under 23, worksheet is automatically created with 29 rows (cols number b is calculated in separated loop and there is no problem with it). Redundant rows can´t be deleted neither automatically nor with code. Is it feature of language, Origin settings or code problem?

Thanks and have a nice day!




Your worksheet has enabled Auto Add Rows.
To disable it, you can use LabTalk script
wks.autoaddrows = 0
, or use okoc_create_workbook() instead.
See
1. http://www.originlab.com/doc/LabTalk/ref/Wks-obj
2. http://www.originlab.com/doc/OriginC/ref/okoc_create_workbook

�c��   �ȥ�  �f�u�c  �c��    �Τ�  �c/     ����
 �c�ʥ� ����  �� ��   ����' �̩���   /��  �թ��f
   ��             ��          ����  �` ��   ��
                              ��






Thanks, works perfectly!

Have a nice day!
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