INTERFACEEND Verb
Syntax
INTERFACEEND
Description
In BBj 6.0 and higher, the INTERFACEEND
verb marks the end of a Custom
Object interface definition.
Notes
The INTERFACEEND verb must be the only statement
on the line (with one exception: it can end with a ; REM comment).
The INTERFACEEND verb is a syntax error
if it's not paired with a preceding INTERFACE verb.
The INTERFACEEND verb may not be nested
within any other CLASS, METHOD, or INTERFACE.
The
interface definition (the area between INTERFACE and INTERFACEEND) can
only contain METHOD statements. Any other statements or labels
contained within the interface definition are unreachable and will not
be executed.
An
interface is similar to a class except that an interface does not define
a method body. An interface definition can only contain METHOD statements.
Within an interface definition, all other Custom Object verbs are considered
to be a syntax error.
Example
rem ' Payroll
e1! = new Salaried()
e1!.setID(1)
e1!.setName("Mary Jones")
e1!.setMonthlySalary(5000)
e1!.print()
print "GL Account:",e1!.account()
e2! = new Hourly()
e2!.setID(2)
e2!.setName("John Smith")
e2!.setHourlyRate(15)
e2!.setHoursWorked(168)
e2!.print()
print "GL Account:",e2!.account()
interface public Address
method public void address()
interfaceend
interface public Pay
method public void print()
interfaceend
interface public GL
method public BBjNumber account()
interfaceend
interface public Payable extends Pay, GL
method public BBjNumber pay()
interfaceend
class public Employee
field public BBjNumber ID
field public BBjString Name$
classend
class public Salaried extends Employee implements Payable
field public BBjNumber MonthlySalary
method public BBjNumber pay()
methodret #MonthlySalary
methodend
method public void print()
print "Employee",#getID(),": ",#getName()
print #pay():"($###,###.00)"
methodend
method public BBjNumber account()
methodret 11111
methodend
classend
class public Hourly extends Employee implements Payable
field public BBjNumber HourlyRate
field public BBjNumber HoursWorked
method public BBjNumber pay()
methodret #HourlyRate*#HoursWorked
methodend
method public void print()
print "Employee",#getID(),": ",#getName()
print #pay():"($###,###.00)"
methodend
method public BBjNumber account()
methodret 22222
methodend
classend
|
See Also
Verbs - Alphabetical Listing