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
 Forum for Origin C
 Output to a specific 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
misrapr Posted - 01/09/2008 : 07:10:06 AM
Origin Version (Select Help-->About Origin): 8 pro
Operating System: xp pro

I want to write some program output to a notes window which already exists. I'm having the name of that notes window in a variable. I'm using type.redirection method. But the problem is that type.notes$ does not support substitution notation means that i can pass the absolute name but not the name stored in a string variable. How to get around this ?? What i understsnd is that both type.redirection and type.notes$ are LabTalk commands. Can i do the same thing entirely using Origin C??

Second thing i want to ask is how can i get the timestamp (using origin C) for a specific time zone?? Although i'm getting GMT.
3   L A T E S T    R E P L I E S    (Newest First)
rlewis Posted - 01/10/2008 : 01:47:43 AM
The following OriginC function should do the trick.
It seems to work in Origin-8(SR1) and, in principle, it should alsi work in Origin-7.5. However, thee seems to be problems with 7.5.

 
bool SendOutputToNote(string strNoteWinName, bool ToNotes)
{
Note nWnd(strNoteWinName);
if(nWnd)
{
if(ToNotes==true) // Turn on redirection to the Notes Window named "strNoteWinName"
{
string strTemp;
strTemp.Format("%s",strNoteWinName);
string strLTCommand="type.notes$="+strTemp;
LT_execute(strLTCommand);
LT_execute("type.redirection=2");
}
else // Turn off redirection to the Notes Window named "strNoteWinName"
{
LT_execute("type.redirection=1");
}
return (true);
}
return false;
}
misrapr Posted - 01/10/2008 : 01:01:45 AM

well that is definitely one way ....

but the problem is that my program generates about 200-300 lines of output (various parameter values, stastistical results, etc ..) at various program steps. In such condition the mentioned process is difficult to apply. Isn't there any other way by which i can tell the program (suppose just before the printf command) to redirect the output to a particular notes window. If a notes window of that particular name exists, append the output to it and if it doesn't exist then first create it and then write into it.

thanks

PM
rlewis Posted - 01/09/2008 : 10:45:08 AM
This can be achieved by converting the program output into lines of text and using an OriginC function something like the following ....


bool add_line_to_note(string NoteWinName, string lpcszText)
{
Note nWnd(NoteWinName);
if(nWnd)
{
string strOld = nWnd.Text;
strOld += lpcszText;
strOld +="\n";
nWnd.Text = strOld;
return (true);
}
return false;
}

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