English
Forum

Objektorientierte Programming

 

Gary12345
Hi,

have time attempts Python code in XPROFAN umzuwandeln and there functions wass not. I try a simple class to create in XPROFAN, now functions The unfortunately not.
CompileMarkSeparation
class Bankkonto = geld!, kontonummer%, geld_abheben@, geld_aufnehmen@, set_geld@, set_kontonummer@

proc neu.set_geld

    parameters wert!
    .geld! = wert!
    return .geld!

endproc

proc neu.set_kontonummer

    parameters kontonr%
    .kontonummer% = kontonr%
    return .kontonummer!

endproc

proc geld_abheben

    parameters betrag!, kontonr%

    if kontonr% = kontonummer%

        .geld! = .geld! - betrag!

    endif

endproc

proc geld_aufnehmen

    parameters betrag!, kontonr%

    if konotnr% = kontonummer%

        .geld! = .geld! - betrag!

    endif

endproc

dim a#, Bankkonto
geld! = a#.set_geld(1000.0)
kontonummer% = a#.set_kontonummer(123456789)
a#.gelf_abheben(500.0, 123456789)
print money!

Python code:
CompileMarkSeparation
And if I in Wikipedia nachsehe (to XPROFAN see) becomes as quality the indicated: ansatzweise object-oriented

How can a Language ansatzweise object-oriented his? and Why is the in XPROFAN so tricky?

@Julian Schmidt) look time in Date Drive.
 
MfG
Gary12345
04/14/13  
 




Julian
Schmidt
must The Gütigkeitsregeln mind
in the Help standing moreover.
following Gültigkeitsmerkmale there: (as prefix)

-: The quality/method is private (private). she's only inside the class famous and becomes with the Veerbung neither berücksichtigt.

#: The quality/method is protected (protected). she's only inside the class and yours go after famous. she'll means with vererbt.

In link with Setter/Getter-modes ought to these quality bevorzugt go.

+: The quality/method is public (public). On tappt im dunkeln can of Program, the Objects this class forms, zugegriffen go.
]


here an example.
CompileMarkSeparation
CLASS Ball = #Farbe&, \
Groesse&, \
Gewicht&, \
getFarbe@, \
setFarbe@

Proc Ball.getFarbe

    Parameters col&
    Return .Farbe&

EndProc

Proc Ball.setFarbe

    Parameters col&
    .Farbe& = col&

EndProc

Declare MeinBall#
Dim MeinBall#,Ball
MeinBall#.setFarbe(RGB(255,0,0))
MeinBall#.Groesse& = 20
MeinBall#.Gewicht& = 10

With MeinBall#

    print .getFarbe()
    .setFarbe(RGB(0,0,255))
    print .getFarbe()

Endwith

waitinput
Dispose MeinBall#
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
04/14/13  
 




Gary12345
Hello,

Thank you!
 
XProfan X2
MfG
Gary12345
04/14/13  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.126 Views

Untitledvor 0 min.
Member 862464103/31/24
Ernst03/02/15
Nico Madysa02/20/14
ByteAttack02/12/14
More...

Themeninformationen

this Topic has 2 subscriber:

Gary12345 (2x)
Julian Schmidt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie