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 Messages in Results Log
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

LukasBurgi

Switzerland
Posts

Posted - 05/24/2005 :  3:19:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

I use the Results Log to output messages (e.g. error messages) during OC code execution. My problem is that whenever a (sub)routine finishes, the Results Log is cleared automatically. Is there a way to get around this problem?

Thanks in advance for advice,
Lukas

eparent

118 Posts

Posted - 05/24/2005 :  3:43:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following function outputs 10 lines of text to the Results Log. The previous contents is not cleared. If you call the function 3 times then the Results Log will have 30 lines of text after the 3rd call.


void test_str_write()
{
string str;
for( int n = 1; n <= 10; n++ )
{
str.Format("text line %d.\r\n", n);
str.Write(WRITE_OUTPUT_LOG);
}
}


Code Builder's Output window is cleared each time a compile happens. Have you verified that your code is really set to output to the Results Log and not Code Builder's Output window? Can you show a snippet of your code?


Go to Top of Page

LukasBurgi

Switzerland
Posts

Posted - 05/25/2005 :  06:30:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The simple example given by eparent works fine. However, just add a few lines of code I often use, and the Output Log is cleared unintentionally.

The problem seems to be the .Rename command. Commenting the line PageBase.Rename("Test") out omits the problem.


void test_str_write()
{
string str;
for( int n = 1; n <= 10; n++ )
{
str.Format("text line %d.\r\n", n);
str.Write(WRITE_OUTPUT_LOG);
}

Worksheet oWorksheet;
PageBase oPageBase;
oWorksheet.Create();
oPageBase = Project.Pages();
oPageBase.Rename("Test");
}

Go to Top of Page

eparent

118 Posts

Posted - 05/25/2005 :  2:36:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I was able to reproduce your problem. Here is an updated example, that works, using your added code and two additional lines of code to inform the Results Log of your output. The first line informs the Results Log that output is coming. This causes the Results Log to output a header for your output. The last line tells the Results Log that the we are done with our output.


void test_str_write()
{
LT_execute("type.beginresults()"); //-------- begin Results
string str;
for( int n = 1; n <= 10; n++ )
{
str.Format("text line %d.\r\n", n);
str.Write(WRITE_OUTPUT_LOG);
}

Worksheet oWorksheet;
PageBase oPageBase;
oWorksheet.Create();
oPageBase = Project.Pages();
oPageBase.Rename("Test");
LT_execute("type.endresults()"); //-------- end Results
}



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