Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > PerlScript (WSH) - Cannot set property

Reply
Thread Tools

PerlScript (WSH) - Cannot set property

 
 
Smugsboy
Guest
Posts: n/a
 
      03-16-2005
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 ?

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      03-16-2005
"Smugsboy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
> 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

 
Reply With Quote
 
 
 
 
Smugsboy
Guest
Posts: n/a
 
      03-16-2005
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,

Tim Hammerquist wrote:
> Smugsboy <(E-Mail Removed)> wrote:
> > 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 ?

>
> You'll need to provide more information about $MyObj in order to get
> a definitive answer. Also, hopefully someone more familiar with
> WSH/PerlScript programming than me is lurking around here. I used
> ASP/PerlScript about 5 years ago, but I haven't kept up.
>
> PerlScript lacks a lot of the syntactic sugar that makes VBScript

look
> so simple. E.g., "default objects." You'll probably need to take
> a deeper look into the $MyObj object and see what, if anything, is

going
> on behind the scenes.
>
> HTH,
> Tim Hammerquist


 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      03-16-2005
"Smugsboy" <(E-Mail Removed)> wrote in news:1110989063.304894.6550
@f14g2000cwb.googlegroups.com:

> 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.
 
Reply With Quote
 
Smugsboy
Guest
Posts: n/a
 
      03-17-2005
No it does not.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<value> could not be set on property <property name> TonyDyer General Computer Support 0 02-14-2012 03:25 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
Access Right for Perlscript to Read Windows EventLog Remotely Joe Perl 1 09-29-2003 05:29 PM
'property value' could not be set on property 'propertyname' KJ ASP .Net Web Controls 0 08-26-2003 06:08 PM



Advertisments