samples.categories.methods.setter.pec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of WebSite Show documentation
Show all versions of WebSite Show documentation
Prompto Documentation Web Site POM
define fullName as Text attribute
define initials as Text attribute
define Person as category with attributes fullName and initials, and methods:
define fullName as setter doing:
// in a setter the attribute name refers to the value received, not to the attribute member
fullName = fullName.toCapitalized
initials = ""
for each word in fullName.split:
initials = initials + word[1]
return fullName
define main as method doing:
p = Person with "arthur rimbaud" as fullName
printLine "p -> " + p
© 2015 - 2024 Weber Informatics LLC | Privacy Policy