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
 Origin Forum
 MOCA example WORKSHEET doesn't work
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marko

Germany
112 Posts

Posted - 07/05/2002 :  05:17:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I just try to code my own MOCA style dll.
Unfortunately I met some problem:

I tried to start with the example worksheet from Origins ATI\MOCA\ tree. Compile and everything works. But for some reason I seem to have a problem with the

MOCA_SIMPLE_PROP_STR(m_WksName, "WksName")!!!

This was set in the property map, but for some reason the following script will crash if I enable the outcommented line:

 
[WorksheetTest]
{
dll -a worksheet ATI\MOCA\worksheet\Debug\worksheet;
// worksheet.WksName=data1; // still causes crash
worksheet.WksName=;
dll -r worksheet;
}

since the output of the worksheet.WksName doesn't create an error, just outputs "--", but assigning something to the variable makes the script finish and so the object wouldn't be deleted as well.

My question: did somebody else also encounter this strange behaviour of the simple property in Origin 6.1 Pro SR4?

Marko

eparent

118 Posts

Posted - 07/05/2002 :  09:02:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
1. Is there really a crash or do you mean a Command Error?
2. When accessing a string property be sure to suffix the name with a dollar sign ('$').


Go to Top of Page

marko

Germany
112 Posts

Posted - 07/05/2002 :  10:10:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks eparent for your response!

to 1)
I meant that Origin just silently stops processing the given script. But this is history, since

to 2)
Well, of course you are right!! So I made the following change:

 
[WorksheetTest]
{
dll -a worksheet ATI\MOCA\worksheet\Debug\worksheet;
worksheet.WksName$=data1; // still causes crash
worksheet.WksName$=;
dll -r worksheet;
}



inserting the dollar signs.

This time the script is executed up to the end, BUT still the output looks like this:

WORKSHEET.WKSNAME$=--

although there was the assignment to the property just the line before!

Any idea what this might be?
Marko

Go to Top of Page

marko

Germany
112 Posts

Posted - 07/05/2002 :  10:13:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
the upper example code still includes the comment with "crash", which is not correct anymore as you see from context of previous post.

Go to Top of Page

eparent

118 Posts

Posted - 07/08/2002 :  10:28:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
LabTalk can not output a string property directly. You have to assign the value to a string variable and then output the string variable. For example:

Worksheet.WksName$=data1; // set prop
%z=Worksheet.WksName$; // prop to str var
%z=; // output str var

Another option is to output the DLL's list of methods and properties with the following:

Worksheet.=;

This will list all the DLL's methods and properties and their current values.


Go to Top of Page

marko

Germany
112 Posts

Posted - 07/08/2002 :  10:58:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks again, eparent!!!
That's the solution. Only now I remember this "feature of Origin". I just checked one of my older scripts and found exactly this behaviour there as well and the same workaround with a buffer string in between.

thanks a lot.

Marko

Go to Top of Page

marko

Germany
112 Posts

Posted - 07/08/2002 :  10:58:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks again, eparent!!!
That's the solution. Only now I remember this "feature of Origin". I just checked one of my older scripts and found exactly this behaviour there as well and the same workaround with a buffer string in between.

thanks a lot.

Marko

Go to Top of Page

marko

Germany
112 Posts

Posted - 07/08/2002 :  10:58:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks again, eparent!!!
That's the solution. Only now I remember this "feature of Origin". I just checked one of my older scripts and found exactly this behaviour there as well and the same workaround with a buffer string in between.

thanks a lot.

Marko

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