VLF-One Interface
VLF-One Interface
I was wondering if someone could post some sample code on how to create/write an interface. I can't seem to find an example.
Re: VLF-One Interface
There's quite a few different interfaces available.
Could you elaborate on the type of interface you want to create?
PS: If you are looking for documented help then use the "Help" menu option:
Also, there's a large set of shipped examples, with source code.
Could you elaborate on the type of interface you want to create?
PS: If you are looking for documented help then use the "Help" menu option:
Also, there's a large set of shipped examples, with source code.
Re: VLF-One Interface
Hey Mark, I'm talking about an interface that a class might implement. Something similar to iListCellDesign.
In Java it would be something like
public Interface IEmployee
{
public String getName();
}
public class Manager implements IEmployee
{
private String name;
public String getName() {
return name;
}
}
In Java it would be something like
public Interface IEmployee
{
public String getName();
}
public class Manager implements IEmployee
{
private String name;
public String getName() {
return name;
}
}
Re: VLF-One Interface
This a general Visual LANSA question (definitely not specific to VLF-ONE applications).
Here a simple Visual LANSA reusable part that defines a class that publicly exposes properties named TheLastName and The Address.
It also exposes methods named MyMethod1 and MyMethod2, along with signallable events named MyEvent1 and MyEvent2.
Once it is compiled you reference it in other code using the DEFINE_COM operation.
You can create static instances of it using the DEFINE_COM operation or by using DEFINE_COM .......... REFERENCE(*DYNAMIC) and SET_REF you can dynamically create multiple instances.
Hope this is enough to get you started on Visual LANSA objects / classes.
Here a simple Visual LANSA reusable part that defines a class that publicly exposes properties named TheLastName and The Address.
It also exposes methods named MyMethod1 and MyMethod2, along with signallable events named MyEvent1 and MyEvent2.
Code: Select all
Begin_Com Role(*EXTENDS #PRIM_OBJT)
* Define a simple event named MyEvent1 that is signalled with no arguments or parameters
Define_Evt Name(MyEvent1)
* Define a event named MyEvent2 that is signalled with 2 parameters named Name and Address
Define_Evt Name(MyEvent2)
Define_Map For(*INPUT) Class(#STD_ALPHA) Name(#Name)
Define_Map For(*INPUT) Class(#STD_ALPHA) Name(#Address)
* Define a property named TheLastName that is stored in variable #LocalSurname
Define_Com Class(#xsurname) Name(#LocalSurname)
Define_Pty Name(TheLastName) Get(*AUTO #LocalSurname) Set(*AUTO #LocalSurname)
* Define a property named TheAddress that returns a constant value
Define_Pty Name(TheAddress) Get(Get_TheAdress)
Ptyroutine Name(Get_TheAdress)
Define_Map For(*OUTPUT) Class(#STD_ALPHA) Name(#ReturnValue)
#ReturnValue := "121 Smith Street"
Endroutine
* Define a method named MyMethod1 that has no aruments (parameters)
Mthroutine Name(MyMethod1) Access(*PUBLIC)
Signal Event(MyEvent1)
Endroutine
* Define a method named MyMethod1 that has 2 arguemnst called UaseName and UseAddress
Mthroutine Name(MyMethod2) Access(*PUBLIC)
Define_Map For(*INPUT) Class(#STD_ALPHA) Name(#UseName)
Define_Map For(*INPUT) Class(#STD_ALPHA) Name(#UseAddress)
Signal Event(MyEvent2) Name(#UseName) Address(#UseAddress)
Endroutine
End_ComYou can create static instances of it using the DEFINE_COM operation or by using DEFINE_COM .......... REFERENCE(*DYNAMIC) and SET_REF you can dynamically create multiple instances.
Hope this is enough to get you started on Visual LANSA objects / classes.