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
 Output to a specific 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

misrapr

India
Posts

Posted - 01/09/2008 :  07:10:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

rlewis

Canada
253 Posts

Posted - 01/09/2008 :  10:45:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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;
}
Go to Top of Page

misrapr

India
Posts

Posted - 01/10/2008 :  01:01:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

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
Go to Top of Page

rlewis

Canada
253 Posts

Posted - 01/10/2008 :  01:47:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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;
}
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