All Downloads are FREE. Search and download functionalities are using the official Maven repository.

samples.categories.methods.setter.pec Maven / Gradle / Ivy

There is a newer version: 0.0.74
Show newest version
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