Blank Lines in Templates

Please log all suggestions for improvements and enhancements to Visual LANSA here. Entries may be acknowledged and may be added to the list for possible inclusion in later releases of Visual LANSA.
Post Reply
jyoung
Posts: 652
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Blank Lines in Templates

Post by jyoung » Wed Mar 22, 2017 4:16 am

Related to the question with the same name http://vlforum.lansa.com.au/viewtopic.php?f=3&t=1267

I think it would be helpful to have blank lines in templates.

Either via a template variable @@BLANK or by getting the template engine to recognize and keep blank lines.

I have custom templates to create VLF server modules and VLF commands that put in boiler plate code and common constructs. The server module template looks like this which is easy enough to read.

Code: Select all



@@QUESTION PROMPT('What is the Application Name') ANSWER(@@CANS001) EXTEND('Use the full Application name, not the identifier')
@@QUESTION PROMPT('What is the Business Object Name') ANSWER(@@CANS002) EXTEND('Use the full Object name, not the identifier')
@@QUESTION PROMPT('What is the Command Name') ANSWER(@@CANS003) EXTEND('Ex. Details, Summary, New, etc.')

@@COMMENT COMMENT('===============================================')
@@COMMENT COMMENT('Type           : Server Module                 ')
@@COMMENT COMMENT('Platform       : Server (Visual LANSA)         ')
@@COMMENT COMMENT('Ancestor       : PRIM_SERV                     ')
@@COMMENT COMMENT('Initial Author : @@USER                        ')
@@COMMENT COMMENT('Written On     : @@DATE8 at @@TIME             ')
@@COMMENT COMMENT('Copyright      : (C) Copyright                 ')
@@COMMENT COMMENT('Framework      : Express Professionals         ')
@@COMMENT COMMENT('Application    : @@CANS001                     ')
@@COMMENT COMMENT('Object         : @@CANS002                     ')
@@COMMENT COMMENT('Command        : @@CANS003                     ')
@@COMMENT COMMENT('===============================================')

begin_com role(*EXTENDS #PRIM_SRVM) sessionidentifier('VLFONE')

* Components
define_com class(#LibraryListManager) scope(*APPLICATION)
define_com class(#VLFServerTraceHandler) scope(*APPLICATION)

* Session Fields
define field(#Persistent_ApplicationString1) type(*NVARCHAR)
persist fields(#Persistent_ApplicationString1)

srvroutine name(Get)
field_map for(*INPUT) field(#wk_CountryCode) parameter_name(CountryCode)
field_map for(*OUTPUT) field(#wk_Status) parameter_name(Status)

#wk_Status := OK

#LibraryListManager.SetLibraryList( #wk_CountryCode )

endroutine

srvroutine name(Save) session(*REQUIRED)
field_map for(*INPUT) field(#wk_CountryCode) parameter_name(CountryCode)
field_map for(*OUTPUT) field(#wk_Status) parameter_name(Status)

#wk_Status := OK

#LibraryListManager.SetLibraryList( #wk_CountryCode )

endroutine

end_com
When it gets executed it looks like this which is more difficult to read.

Code: Select all

* ===============================================
* Type           : Server Module
* Platform       : Server (Visual LANSA)
* Ancestor       : PRIM_SERV
* Initial Author : JRYOUNG
* Written On     : 2017/03/21 at 12:02:40
* Copyright      : (C) Copyright
* Framework      : Express Professionals
* Application    : Credit Management
* Object         : Credit Control Panel
* Command        : Notes
* ===============================================
begin_com role(*EXTENDS #PRIM_SRVM) sessionidentifier('VLFONE')
* Components
define_com class(#LibraryListManager) scope(*APPLICATION)
define_com class(#VLFServerTraceHandler) scope(*APPLICATION)
* Session Fields
define field(#Persistent_ApplicationString1) type(*NVARCHAR)
persist fields(#Persistent_ApplicationString1)
srvroutine name(Get)
field_map for(*INPUT) field(#wk_CountryCode) parameter_name(CountryCode)
field_map for(*OUTPUT) field(#wk_Status) parameter_name(Status)
#wk_Status := OK
#LibraryListManager.SetLibraryList( #wk_CountryCode )
endroutine
srvroutine name(Save) session(*REQUIRED)
field_map for(*INPUT) field(#wk_CountryCode) parameter_name(CountryCode)
field_map for(*OUTPUT) field(#wk_Status) parameter_name(Status)
#wk_Status := OK
#LibraryListManager.SetLibraryList( #wk_CountryCode )
endroutine
end_com
I am aware of using comments as blank lines, but I feel like that is a hack-ish workaround. Empty comments do not help the read ability, it makes me think something is missing. I added extra text to the comment that can then be removed by a find and replace like @@COMMENT COMMENT('[BLANKLINE]') but that is an extra step that should not have to occur.

It is a small thing in the scope of the larger LANSA picture, but it would be nice to have IMHO. ;)

User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Blank Lines in Templates

Post by Stewart Marshall » Wed Mar 22, 2017 7:46 am

Couldn't agree more

It should be available very soon
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au

Post Reply