Book a Demo

Author Topic: Get/Set properties  (Read 3705 times)

ctorres

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Get/Set properties
« on: September 26, 2007, 05:58:12 am »
I want show Get/Set methods in generated code. There is a way to do this ???

Thanks in advance.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Get/Set properties
« Reply #1 on: September 26, 2007, 08:50:01 am »
Take a look at the bottom of the Tools | Options | Source Code Generation dialog. You'll see various options for detecting an attribute you want to have translated into a property, and how it will be named.

Once you've got these set up the way you want, create your attributes with the necessary prefix (or suffix if you've chosen that option). If you want only a Get (or a Set) property then look at the attribute dialog and choose read only (or whatever).

David

[And, please post to only one forum section.

Most of us read all the sections, so you will get an answer just as fast. However, if there is ongoing discussion or follow-up, we'll all be able to see it in one place.]
« Last Edit: September 26, 2007, 08:59:15 am by Midnight »
No, you can't have it!

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Get/Set properties
« Reply #2 on: February 22, 2008, 02:48:41 pm »
I'm dragging this up for personal reasons.  (My memory is failing!)

For C++, I want to have getters with no prefix and setters with "set".  Setting the setter prefix to "set" sets up everything nicely.  But if I delete "get" in the getter option it still generates accessor names with "get" in front of them.

Can someone please confirm this aint working or whether its only for me.  It may be a peculiarity of the linux version and I don't want to send Sparxians off on a goose chase.

bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Get/Set properties
« Reply #3 on: February 22, 2008, 03:04:44 pm »
I remember that this is the case, and that it has come up before.

Unfortunately my memory fails me sometimes too and I can't remember why it's that way.  :-[