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
 clearworksheet does not clear
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tinkusch

Germany
94 Posts

Posted - 05/27/2002 :  05:05:15 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin v7.0 SR1, German Win98

Hi

The command 'clearworksheet' shows a somewhat peculiar behavior:
Create a worksheet 'mywks' with let's say 500 rows and three columns, labeled X, Y and L. Fill it with some data. After
that clear the wks with the labtalk command 'clearworksheet mywks'. The entries disappear from the wks and the number
of rows is set to 30, which is ok. If one then executes the following Origin-C program :

int Test()
{
Dataset Res1("mywks_X");
Dataset Res2("mywks_Y");
Dataset Res3("mywks_L");
Res1.SetSize(500);
Res2.SetSize(500);
Res3.SetSize(500);
return 0;
}

the old content of mywks is restored again!
It is also restored, if the C-program is compiled after the command clearworksheet, and then executed.
How do I really get rid of it?

Stefan

cpyang

USA
1406 Posts

Posted - 05/27/2002 :  3:14:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
ClearWorksheet is a macro, as you can see by typing

def ClearWorksheet;

and it is only resizing the display range without setting the cells to missing values. Which is a different behavior then the ClearWorksheet context menu command when right click in the empty space in the worksheet. This is something that we need to fix in the future for consistency.

For now, you can ensure your worksheet is filled with missing values by simply adding

Res1=get_missing_value();
Res2=get_missing_value();
Res3=get_missing_value();

to your Origin C function, after your call to SetSize.

CP


Go to Top of Page

tinkusch

Germany
94 Posts

Posted - 05/28/2002 :  03:05:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works, thanks, CP!

Stefan
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