Breaking line in template text writing line continuation

Dears,

this could be a silly question , it is about writing inside the template lines.
in application for writing one line in multiple lines we use ‘|’ mark; for example:

String = ‘this is a sample for breaking lines’

can be written as

String = ‘this is a sample for ’ |
& ’ breaking lines’

is ther a way to do the same in writing template texts as I have a long text in the #prompt and it is hard to follow while modifying the template text.
for example:

#PROMPT(‘Notes’,TEXT),%Comments,Default(‘this is a sample for breaking lines’),at(,170,100)

I want to break this line in multiple lines in the way of writing inside the template file not the output.

thank you in advance

AFAIK it is not supported.

Unfortunately.

Thank you

I thought %| and found in the Help it’s used, but it does not really work:

For this and all other code examples in this book, the template line continuation character (%|) is used to split code lines that are too long to fit on the page. In the template files on disk these characters are not (and should not be) used to continue a template code line; they are used here only for readability

you could try it…

http://clarion.help/doku.php?id=procedure_template_window.htm&s[]=continuation

I will try it
thanks

All these examples work:

#Assert(%False,'Class generation completed.<13,10><13,10>Click OK to compile the Debug Test App.<13,10>Click CANCEL then CLOSE to abort.<13,10><13,10>Build:Debug')

#Set(%localmessage,'Global Bitmasks declared in the global extension.<13,10>Enabled Global Bitmasks populated in global embeds.<13,10>')

#Declare(%CRLF)
#Set(%CRLF,'<13,10>')

#Prompt('CRLF',@s255),%CRLF,Req,Default('<13,10>')

#Set(%EmbedInfoText,'')
#Set(%EmbedInfoText,%EmbedInfoText  & '%CWVersion:                '   & %CWVersion                              & %CRLF)
#Set(%EmbedInfoText,%EmbedInfoText  & '%ProcedureLanguage:        '   & %ProcedureLanguage                      & %CRLF)
#Set(%EmbedInfoText,%EmbedInfoText  & '%CWRoot:                   '   & %CWRoot                                 & %CRLF)
#Set(%EmbedInfoText,%EmbedInfoText                                                                              & %CRLF)

Not a CR/LF but a TAB

#Prompt('Tab 4',@s255),%Tab,Req,Default(' ')

#Set(%LinkFieldarrayLoopCodeEnd,%LinkFieldarrayLoopCodeEnd & %Tab & %Tab & %Tab & %Tab & 'End' & %CRLF )

#Set(%paramPassingConventionText, %paramPassingConventionText & 'Floating point parameters are passed on the floating point stack registers st0, st1, st2, st3, st4, st5 and st6.<13,10> ')

#PROMPT('Extra Text to Display:',Text),%DebugviewText,Default('Loc:IS_DebugViewCstring=''Whatever''<13,10>IS_DebugView(Loc:IS_DebugViewCstring)')

Hash them how ever you like, ie you could use
#Prompt…default(%somepreviouslydeclaredvar)
where %somepreviouslydeclaredvar is filled using #set(%somepreviouslydeclaredvar,%somepreviouslydeclaredvar & 'whatever')

You can create any number of %templatesymbols and #set them with any number of special values like <13,10> and other ASCII symbols so you can even do some ascii art if you fancied.
:grinning:

Edit.
sidenote wbproc.tpw line 846 looks that should be

ELSE%|

and not

ELS%|

no I think ELS is correct as it is in a loop and the idea is the next IF will be changed into ELSIF

similar idea on line 1036

It just stuck out as a bit odd but I didnt investigate any more.

hello,
I tried this method but the problem with me is where to declare the %somepreviouslydeclaredvar because I tried to declare it in the same location but didn not work.

thank you

You cant use #Declare inside a

#Sheet
#Tab('text')
#Prompt('Text',SOMETHING),%symbolvar
#EndTab
#EndSheet

You can (sometimes/mostly) in a

#Group(%grpSomeGroup)
#Declare(%TemplateSymbol)
#Set(%TemplateSymbol,something)

I say sometimes because I have an extra tab on my templates which I call debug which makes the %templatesymbol a sort of global variable and then I can access the %templatesymbol from within #groups.

#Declare inside a group makes it like a local variable, ie its scope is confined to the group only.

So if you have a
#Application / #Module / #Procedure / code
#Prepare
#Declare(%templatesymbol)
#Set(%templatesymbol,something)
#EndPrepare

I get inconsistent behaviour, ie sometimes I can use it as a “global” variable for the scope of where ever its defined ie
#Application (scope application) or #Procedure (scope procedure), but sometimes I cant access the %templatesymbol from a group so thats why I use the debug tab, I can at least see what the value is without going the extra adding #Call(%DebugView(‘Some Message’)) to the template code. I havent got to the bottom of why I see inconsistent behaviour.

And because of this inconsistent behaviour, I cant rule out if this is hackers messing with the system, some bug or something else, the reason I say this is like today, I’ve had constant messages saying the file has been reloaded, do I want to reload Yes or No? Its made it very difficult to do any work and the mouse cursor usually selects a random block of code in the clarion editor, so I spend alot of time dealing with these popup messages.

I also get cookies in MS Edge which wont delete, I have to manually delete them so I suspect there is some sort of file handle shenanigans goings on, just like the MS Edge translate can be used to alter the text on any website to read absolutely anything, alongside the obvious of just translating a website from one language to another.

So because of the problems with this computer, take what I have put above with a pinch of salt, I am very aware, this could be the behaviour I am being made to see on my machine.

Hello,
I tried the suggested options but I unfortunately could not accomplish the task. any how this the require part of my template:

#TEMPLATE(LineBreakTest,‘LineBreakTest’),FAMILY(‘ABC’)
#!-----------------------------------------------------------------------
code(LineBreakTest, ‘(LineBreakTest’),DESCRIPTION( ‘(LineBreakTest)’)
#!-----------------------------------------------------------------------
sheet
#Tab(‘Tab1’)
#PROMPT(‘Queue Name: ‘, @s20 ),%Qname, REQ,Default(‘QG’)
********* this is my original code *******************
#PROMPT(‘Notes’,TEXT),%MyNotes,Default(’!--------<13><10> sk_Root_Files = ‘’.’‘<13><10> Do test_records<13><10>!--------------<13><10>’),at(,170,100)
#!************ this what is expected ***************************
#Declare(%Comments)
#Set(%Comments,‘’)
#set(%Comments,%Comments & ‘!--------------<13><10>’)
#set(%Comments,%Comments & ‘sk_Root_Files = ‘’.’‘<13><10>’)
#set(%Comments,%Comments & ‘Do test_records<13><10>’)
#set(%Comments,%Comments & ‘!--------------<13><10>’)
#PROMPT(‘Notes’,TEXT),%MyNotes,Default(‘%Comments’),at(,170,100)
#!************ END (this what is expected) **************************
#EndTab
#EndSheet

thank you for your patience.

Shouldnt that be no single quotes in the Default(%Comments) ?

There is a space between <13,10> and sk_Root_Files, that doesnt match the #Set(%comments section of template code. FYI

Here is another you can set/fill #Prompts which I missed.

#Prepare
#Call(%grpLOCwaPreparePopulate )
#IF(%PopulateGlobally=%True)
#Set(%localmessage,'Global Bitmasks declared in the global extension.<13,10>Enabled Global Bitmasks populated in global embeds.<13,10>')
#Set(%localmessage,%localmessage &'Additional Local Bitmasks can be declared here.<13,10>Local Bitmasks populated in this procedure.')
#Else
#Set(%localmessage,'Global Bitmasks copied from the global extension.<13,10>Additional Bitmasks can be declared here.<13,10>')
#Set(%localmessage,%localmessage &'All enabled Bitmasks populated in this procedure.')
#EndIF
#EndPrepare
#Sheet
#Tab('Local')
    #Display()
    #Display('Local Bitmasks Extension Template')
    #Display()
    #Prompt('Bitmasks',Text),%localmessage

It does work because I use it alot in templates.

#Group(%grpNOTEconstant)
#Set(%paramNotes,'')
#Set(%paramNotes,%paramNotes &  'CONST only works with parameters passed by address and prevents the parameter')
#Set(%paramNotes,%paramNotes &  'address and value from being modified. Think of it like a read only flag. ')
#Set(%paramNotes,%paramNotes &  'You can use the default value of CONST but you can also specify an Equate label ')
#Set(%paramNotes,%paramNotes &  'with the value of CONST (eg label Equate(CONST) ) if you need to make the CONST ')
#Set(%paramNotes,%paramNotes &  'value more informative in some way. It also has the advantage of using less memory ')
#Set(%paramNotes,%paramNotes &  'as a structure that is Giga/Mega/Kilobytes in size doesnt get copied to another ')
#Set(%paramNotes,%paramNotes &  'part of memory. Some programmers find it useful for making sure memory addresses ')
#Set(%paramNotes,%paramNotes &  '(pointers & references) dont get changed inside the procedure/function. ')

#Group(%grpNOTEparamExplain)
#Case   (%paramExplain)

#OF     ('Constant')
        #Call(%grpNOTEconstant)

#Tab('Notes')
    #Display()
    #Prompt('Explain:',Drop('Data Type|any unTYPEd|Entity|named TYPE|Pass By|Array|Constant|Label|Default Value|OMITtable|Procedure Name|Class Name|TYPE''d Structure|Linked Variable')),%paramExplain,At(100),WhenAccepted(%grpNOTEparamExplain() )
    #Prompt('Notes:',TEXT),%paramNotes,AT(5,50,182,200)
    #Display()
#EndTab
1 Like

Sorry that was a typing mistake.

now it is working fine.

thanks a lot for your help and patience.