Shortcut for entering code snippets (using templates) in V14

This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. 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
Posts: 19
Joined: Fri Jun 10, 2016 12:14 pm

Shortcut for entering code snippets (using templates) in V14

Post by Dominik » Fri Jun 10, 2016 12:36 pm

In version 14, you can now execute code templates just by typing the template name in the source code and pressing Enter
template1.PNG (5.79 KiB) Viewed 4977 times
This means you can easily execute templates to insert often used code snippets, or help you write longer coding constructs. VL ships with quite a few 'Building Block' templates, but you can also create your own to suit your own style of coding/needs. Template coding is somewhat different to regular LANSA coding, however it is easily learned by looking at the shipped samples.

Note that even though LANSA reports the line as not being a valid command, pressing Enter executes the template. Finishing the template will replace the template name in your source with the output of that template
template3.PNG (14.44 KiB) Viewed 4977 times

Post Reply