Startseite > lang > propdecl 
 en fr es it nl pl pt pt_BR mk sq ca hu cs tr ar fa id vi ko ja ru zh zh_TW eo
Zurück  Weiter  Bearbeiten  Umbenennen  Rückgängig  Suchen  Verwaltung  
Dokumentation  
Achtung! Diese Seite wurde noch nicht übersetzt.  Siehe englische Version 
Property Declaration
PROPERTY [ READ ] Identifier AS Datatype

Nur in der Version 3.1

PROPERTY [ READ ] Identifier [ , Synonymous1 [ , Synonymous2 ... ] ] AS Datatype

This declares a class property.

If the keyword READ is specified, then the property will be read-only.

Once declared, a property must be implemented : you must write a function to read the property, and, if not read-only, a function to write the property.

The name of the read function is the name of the property followed by an underscore and the word Read. This function takes no argument and must return a data whose type is the same as the property datatype.

The name of the write function is the name of the property followed by an underscore and the word Write. This function is a procedure that returns nothing, and that takes only one argument whose type is the same as the property datatype.

Property Synonymous

Nur in der Version 3.1

It is possible to declare up to three synonymous to the declared properties by using the second syntax.

Beispiel

PROPERTY Enabled AS Boolean
PROPERTY READ Handle AS Integer
...

PRIVATE $bEnabled AS Boolean
PRIVATE $iHandle AS Integer

' Implements the Enabled property

FUNCTION Enabled_Read() AS Boolean

  RETURN $bEnabled

END

SUB Enabled_Write(bEnabled AS Boolean)

  $bEnabled = bEnabled
  UpdateEverything

END

' Implements the Handle property

FUNCTION Handle_Read() AS Integer

  RETURN $iHandle

END

Siehe auch

Method Declaration