SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Прошу разъяснить про объект класса



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
shevchenko
Участник
Участник



Joined: 15 Apr 2010
Posts: 1

PostPosted: Thu Apr 15, 2010 11:31 am    Post subject: Прошу разъяснить про объект класса Reply with quote

Имеем нижеследующий код:
Code:
class counter definition.
  public section.
    methods: set importing value(set_value) type i,
             increment,
             incr2,
             get exporting value(get_value) type i.
  private section.
    data count type i.
endclass.

class counter implementation.
  method set.
    count = set_value.
  endmethod.
  method increment.
    add 1 to count.
  endmethod.

    method incr2.
    add 1 to count.
  endmethod.

  method get.
    get_value = count.
  endmethod.
endclass.

data number type i value 5.
data cnt type ref to counter.

start-of-selection.

  create object cnt.

  call method cnt->set exporting set_value = number.

  do 3 times.
    call method cnt->increment.
  enddo.

  call method cnt->get importing get_value = number.

  write number.


если поставить точку прерывания на строку
Code:

call method cnt->set exporting set_value = number.

и под отладчиком кликнуть на объекте cnt, то получим

{O:3*\PROGRAM=ZDEMO_CLASS_COUNTER\CLASS=COUNTER}

Вопрос, что означает цифра "3" - почему ни один, ни два, а именно 3?
Back to top
View user's profile Send private message
blackfish
Участник
Участник



Joined: 19 Apr 2010
Posts: 1

PostPosted: Mon Apr 19, 2010 12:07 pm    Post subject: Reply with quote

Read this one:

http://help.sap.com/SAPHELP_CRM50/helpdata/EN/7f/061640033ae569e10000000a155106/frameset.htm
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.