Author Topic: can't set  scale  Attribute ???  (Read 6774 times)

alvinhsieh

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
can't set  scale  Attribute ???
« on: September 19, 2006, 10:42:52 pm »
For f = 0 To elm.Attributes.count - 1

Set att = elm.Attributes.GetAt(d)

att.Scale="10"

Next
,
i can print att.scale ,but can't setting it ?
please help me
thanks


KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #1 on: September 19, 2006, 11:17:32 pm »
You may need to do att.Update()
« Last Edit: September 19, 2006, 11:18:03 pm by KP »
The Sparx Team
[email protected]

alvinhsieh

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #2 on: September 20, 2006, 05:08:18 am »
VB6 can't recognize This line' att.scale ="10" '

But,in debug windows i can print  att.scale.

thomaskilian

  • Guest
Re: can't set  scale  Attribute ???
« Reply #3 on: September 20, 2006, 11:44:36 am »
It's probably an integer?

alvinhsieh

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #4 on: September 21, 2006, 02:55:36 am »
in help->
mk:@MSITStore:C:\Program%20Files\Sparx%20Systems\EA\EA.chm::/attribute.htm
scale attribute is  String
'Scale  String  Read/Write.  Scale value. '

this problem seem come from VB6 ,because  in design time VB6 IDE  'att.scale ="10"' will turn to red.

thomaskilian

  • Guest
Re: can't set  scale  Attribute ???
« Reply #5 on: September 21, 2006, 02:27:20 pm »
Despite of the help: did you try to assign an integer?

alvinhsieh

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #6 on: September 22, 2006, 12:30:29 am »
Set att = Elm.Attributes.GetAt(f)
att.Update
att.Scale =1

assign integer ,result is same.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #7 on: September 22, 2006, 04:01:33 am »
Remember to call att.Update() again after the assignment, otherwise EA will silently ignore the new value.
No, you can't have it!

thomaskilian

  • Guest
Re: can't set  scale  Attribute ???
« Reply #8 on: September 25, 2006, 02:31:25 pm »
Looks like the interface definition from Sparx is not right (can't remember the suffix of those files) as VB complains about the wrong type. Did anyone from Sparx try this sample, Neil?

Whitestar

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #9 on: June 28, 2007, 07:08:56 am »
VB seems to be expecting the syntax for its own built-in Scale method, i.e.:
         object.Scale (x1,y1) - (x2,y2)

This is why it complains & asks for a bracket.

This is clearly a bug.  Sparx guys: is there a fix for this?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #10 on: June 28, 2007, 09:26:05 am »
You should submit this as a bug to Sparx directly. The help entry for the Scale property does not appear to be corrected through build 812 (EA &.0 beta 3) inclusive.

You can find the correct form by clicking the Support link at the top of any forum page, then clicking Bug Report in the left side menu. Or from the EA main menu choose Help | On-line Resources | Bug Report Page.

David
No, you can't have it!

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #11 on: June 28, 2007, 02:16:45 pm »
I don't think this is a problem with EA's interface.  The problem here is that 'Scale' is unfortunately a keyword in VB.  To get around this, put square brackets around Scale and it should work.
e.g.   attrib.[Scale] = 1

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #12 on: June 28, 2007, 04:26:15 pm »
Yep, that would likely help...
No, you can't have it!

Whitestar

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: can't set  scale  Attribute ???
« Reply #13 on: June 28, 2007, 10:01:13 pm »
Quote
I don't think this is a problem with EA's interface.  The problem here is that 'Scale' is unfortunately a keyword in VB.  To get around this, put square brackets around Scale and it should work.
e.g.   attrib.[Scale] = 1


Thanks for that.  It works perfectly. :)
I didn't know you could do that in VB!!!

Well done.

Cheers,

Paul

thomaskilian

  • Guest
Re: can't set  scale  Attribute ???
« Reply #14 on: June 28, 2007, 10:21:28 pm »
N.B. In Perl (I also learned from Sparx) you have to use braces like $attrib->{Scale} = 1 to make an assignment while $attrib->Scale also legally prints the contents. I did not know that Perl and VB are so related ;)