PerlScript (WSH) - Cannot set property

S

Smugsboy

Hi,
I have an application which uses Microsoft's ScriptControl as a script
host for PerlScript.
I add an object to it that contains a property.

When I try to read the propery I succeed using the following syntax:
$MyObj->Prop1

However, whem I try to write to the propery using the following syntax
I get an error:
$MyObj->Prop1 = 6;

Any ideas ?
 
P

Paul Lalli

Smugsboy said:
Hi,
I have an application which uses Microsoft's ScriptControl as a script
host for PerlScript.
I add an object to it that contains a property.

When I try to read the propery I succeed using the following syntax:
$MyObj->Prop1

However, whem I try to write to the propery using the following syntax
I get an error:
$MyObj->Prop1 = 6;

Any ideas ?

Several.

What is the object? How was it created? How is Prop1 defined? What is
the error you received?

What you have just done is the equivalent of calling a mechanic, telling
him "my car doesn't go forward. Any ideas?"

Have you read the posting guidelines posted to this group twice a week?

Paul Lalli
 
S

Smugsboy

MyObj is a .NET managed object declared in C# in the following way:
class MyObj
{
MyObj() {}

private int m_prop1;

public int Prop1
{
get { return m_prop1; }
set { m_prop1 = value; }
}
}

It is added into Microsoft's Script Control and used through
PerlScript.
I need to add that accessing Prop1 works fine with VBScript & JScript.
Any idea ?
Thanks,
 
A

A. Sinan Unur

Hi,
I have an application which uses Microsoft's ScriptControl as a script
host for PerlScript.
I add an object to it that contains a property.

When I try to read the propery I succeed using the following syntax:
$MyObj->Prop1

However, whem I try to write to the propery using the following syntax
I get an error:
$MyObj->Prop1 = 6;

I have never used PerlScript, but does the obvious way work?

$MyObj->Prop1(6);

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top