How do I add comments in my code via the Editor view for my Actions? I know this is a simple question, but I haven't been able to figure it out, and this seems almost impossible to Google for.
I've tried some of the standard commenting types, none of which have worked:
//
/* */
#
--
I know I can add text to the Description attribute for an Action, but I'd like to be able to comment out specific lines in my code as needed.
Do you mean the expert view where you see the generated code?
You can use the single quote character for that:
' The user needs to be informed that the test is ready to run, so
' he can take appropriate actions before continue or Cancel if needed.
If MsgBox("The test is ready to start.", VbOKCancel) <> VbOK then
ExitTest
End If
Shortcut to comment/uncomment blocks: Ctrl+M and Ctrl+Shift+M
Related
In visual studio code, I tried to comment out my javascript code so that I don't need to copy and past multiple times when I try something else on the same file.
I tried the method of /* code */ and // code. While they are collapsable when used seperately by non comment content, they automatically disable the collapsable status upon adding them comment consecutively.
How can I work around this situation?
Yes I have find the solution to it.
Before commenting them, make sure it is already collapsed.
Then comment them multiple lines of code like below.
/*
code
*/
Instead of this
/*code*/
The new line matters as it makes the auto disable collapseable problem disappear.
I am using BIRT Designer, I am having an issue of page break when generating the report as PDF.
After generating the PDF report, What happen is since the note from the input file is too long for the description column to accommodate some of the string is being pushed down to next line or being wrap to ensure that the note fits in the description column area which cause for the trailer details to be push to the next page.
I have tried many page break options like avoid before and after for tables/grid but nothing is working.
Please find the attachment of sample pdf for getting page break issue and rptdesign file and xml file.
So Please give some suggestion to solve as soon as possible.
Thanks and Regards,
Sharath.
I had similar issues in the past and found these answers a long time ago.
Set the page break interval to zero and see if this works for you. The page break before, inside and after settings should be set to Auto as setting something to avoid will always try to avoid page breaks when displaying your selection. Auto will use page breaks where necessary.
Check to see if this works for you.
You can also try entering this code in the beforeFactory section:
if( reportContext.getOutputFormat() == "pdf" ){
reportContext.getReportRunnable().designHandle.getDesignHand le().findElement(
"mytable").setProperty("pageBreakInterval",
0);
}
Go to the script tab and then change the name "mytable" to the name you have given your table under Properties > General > Name
I see that Writer class has methods to insert Text. However, I fail to understand as to which of those methods is the right one to insert HTML into the editor.
Explanations
My case scenario is:
A User can create certain content template and save it. Later the user should be able to insert that same content into the editor and start modifying.
I'm handling this using the following code
activeCKE.model.change( writer => {
writer.insertElement( "text to insert", activeCKE.model.document.selection.getFirstPosition() );
activeCKE.setData(activeCKE.getData()); // to refresh the contents
}
It works well with "**text**" but not with " <strong>text</strong>". The latter appears as-is.
So my question is; What is the right way to insert the HTML string programatically that has already been created using something like the Writer class?
I see there is a concept of template in ui/template, however I'm unclear as how to convert editor.getData() to that template.
Please Note: I don't want to give the user an HTML editing interface. I just want to create templates to make his life easier. Hence my question has nothing to do with 'View Source Code' based questions.
While I continued my research post asking this question, I landed onto FAQs, where I got my answer.
const viewFragment = activeCKE.data.processor.toView( "<p>HTML Text</p>" );
const modelFragment = activeCKE.data.toModel( viewFragment );
activeCKE.model.insertContent( modelFragment, activeCKE.model.document.selection );
This satisfies my use case. However, I encourage the community to post other possible variations, such as using Template class. Especially because line-breaks due to any kind of tag (br, p etc) are filtered out.
Developers interested to show the source code & allow source code manipulation in CKEditor 5, can create a plugin that shows the contents of editor.getData() in a dialog (or something they like) and then reset the contents of editor and insert the content in a fashion similar to the one demonstrated above.
I have an ecommerce gift store where users can fill out a gift-card for their recipient.
In order to fill out the card, I have the users enter text into a multiline textbox.
When I display the gift-card on the final review page, I have to spit out the information with Html.Raw so that Newlines are being displayed properly. I'm doing this:
#(Model.GiftCard.Text != null ? Html.Raw(Model.GiftCard.Text.Replace(char.ConvertFromUtf32(13),"<br />")) : Html.Raw(""))
I'm frightened that i'm entering dangerous territory using Html.Raw on values that were user-entered. However, when I go back to the gift-card entry page, the page breaks when I try to do something like "This is my gift card! (scripttag)alert('test');(/scripttag)"... so I feel like .net will catch any malicious entries during that point.
Am I safe to proceed like this? It seems that since the gift-card entry page is running validations against malicious code, I should be okay to use HtmlRaw later to display newline html that I'm putting in myself...
(I replaced the actual script tag with this (scripttag) thing above so it will show in stackoverflow)
Use a regular expression in your view model to make sure people only enter A-Za-z0-9 and whatever else you think should use such as :) =] type of stuff. Screening this stuff front end is better than second guessing it on the way out.
How about using a
<pre></pre>
tag instead? This would allow returns to display in HTML without the need for Html.Raw?
How do you add a Hyperlink to a word document using an existing bookmark. I have been testing using IRB but continue to get Command Failed.
I have attached to a running word application have text selected that I want to tie to the hyperlink. For testing I have been trying to just add a google hyperlnk. I figure once I get that then I would be able to figure out the bookmark. This is the command I am using
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
The two blank parms are for SubAddress and ScreenTip respectivly.
Luke-
You're very close...
Change this...
doc.Hyperlink.add(word.selection, 'http://www.google.com', '','','text to display')
...to this...
doc.Hyperlinks.add(word.selection.Range, 'http://www.google.com', '','','text to display')
There were two changes necessary:
(1) You call the Add method on the Hyperlinks (plural) collection, and (2) the first argument needs to be a Range object.
With these changes, your code works for me.