Base class for Panel

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Base class for Panel

Post by soa »

This is pproably VL 11 but...

When I create a new RP from, say, a tile design It is created with a set of method routines, eg OnAdd, with the redefine option. When I save my own panel as myBasePanel and set the *EXTENDS value to point to it it's method routines do not appear in the new panel. How do I make my base RP act like the LANSA ones.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Base class for Panel

Post by Stewart Marshall »

Hi Jim

The short answer is "manually"

As part of the creation of Design parts, we specifically inject code, something we do primarily to save you the keystrokes as you're likely going to need some of the routines.

However, changing the Ancestor or the implemented interface doesn't have any effect on the source. You need to manually code you any redefined routines.

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Base class for Panel

Post by soa »

Surely the same applies with user defined RPs - I know which routines I'm going to use and what code I would like to see included (instance specific, obviously, not generic. The fact that you include these method demonstrates that it is useful. I think it would be a good addition. Obviously some new markup/decoration would be required.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Base class for Panel

Post by Stewart Marshall »

Hi Jim

I understand the argument, but I suspect that anything we could automate would risk causing more problems than it solves. Automatically inserting statements in to existing source is a minefield at best.

So perhaps a more pragmatic middle ground; one where you decide what needs redefining and we help you do it quickly.

Attached is an export containing a handful of templates that I use regularly to write the lines of code I write over and over e.g. Define_Map, define_evt and yes, redefining methods.

The templates all have short names such as RM for redefine method or DIM for define input map.

At some point in relatively recent history, we enhanced the editor so that templates could be executed simply by typing the name at the start of a line and pressing enter. To redefine a method, I type RM and press enter. This inserts the following

Code: Select all

Mthroutine Name() Options(*Redefine)
Endroutine
I can then position the cursor in the Name parameter and use Ctrl+Space to select from a list of Ancestor Features.

Suitable compromise...if we do something more intelligent with the cursor position?

Regards
Attachments
Snippets.zip
(5.1 KiB) Downloaded 1197 times
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
soa
Posts: 339
Joined: Mon Dec 07, 2015 3:15 pm

Re: Base class for Panel

Post by soa »

Thanks I'll have a look.
Post Reply