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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 How to clear notes window?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tib Posted - 10/23/2003 : 04:51:42 AM
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.

3   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 10/23/2003 : 1:37:00 PM
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


tib Posted - 10/23/2003 : 12:36:21 PM
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.

rlewis Posted - 10/23/2003 : 12:10:23 PM
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);
}

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000