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
 LabTalk Forum
 How to clear notes window?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tib

Switzerland
105 Posts

Posted - 10/23/2003 :  04:51:42 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
does anybody know how to clear a notes window?
When I open a new data file
open -n FileName NotesName
the datafile will be appended (and not overwritten what I'm looking for).
Of course, I could delete and create the notes window again and again...
loop (i,1,1000) {
win -n notes TempNotes; // create notes window;
open -n Data$(i).txt TempNotes; // import text into notes window;
... do some operations and extraction on it...
win -cn TempNotes; // delete notes window without prompting;
};

This leads to flickering windows and probably slows everything down. OK, it's not that too bad but I just thought that there is something like ClearWorksheet wksName.
Thanks, Tilman.

rlewis

Canada
253 Posts

Posted - 10/23/2003 :  12:10:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you are using version 7 and Higher the following OriginC function should do the trick ...
bool clear_note_Window(string NoteWinName)
{
Note nWnd(NoteWinName);
if (nWnd)
{
nWnd.Text="";
return (true);
}
return (false);
}
Go to Top of Page

tib

Switzerland
105 Posts

Posted - 10/23/2003 :  12:36:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi rlewis,
your suggestion works fine. Although there seems to be no improvement in speed (as I was hoping). Maybe I have to try to hide the window somehow during import, with the win -o {} command?!
Thanks, Tilman.

Go to Top of Page

cpyang

USA
1407 Posts

Posted - 10/23/2003 :  1:37:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following OC program will read 100 origin.ini files and append them all into a single note window (nwToKeep). On my computer it took 17 sec to execute.


void test()
{
Note nwToKeep;
nwToKeep.Create();

for(int ii = 0; ii < 100; ii++)
{
Note nwTemp;
// can replace with you real file here
string strFile = GetAppPath() + "origin.ini";
//
nwTemp.Create(CREATE_HIDDEN, strFile);
string strText = nwTemp.Text;
if(strText.GetLength() > 0)
{
nwToKeep.Text += "******\r\nFile" + (ii+1) + ":" + strFile + "\r\n******\r\n";
nwToKeep.Text += strText;
}
nwTemp.Destroy();
}
}




CP


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