I'm using UE v15.20.0.1022.
Being an old-fashioned mainframe techie I know nothing about JS but using the UE documentation and info gleaned from these fora I've managed to create a script to extract certain data from PL/I source code. As part of my data extract I need to preserve the line number on which code is situated. The first part of my script clears down all the comments in the program...
I initially used...
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.perlReOn();
UltraEdit.activeDocument.top();
var searchRegexp = "/\\*(.|[\\r\\n])*?\\*/";
UltraEdit.activeDocument.findReplace.replace(searchRegexp,"");
This is fine for comments wholly on a single line, but if a comment spans several lines I need the comment to be replaced with the same number of blank lines so as to preserve subsequent line numbers.
I did some reading on findreplace.replace and it seems to indicate that the 2nd argument can be a function. Is this true in the implementation of JavaScript in UE? I've tried all sorts but can't seem to get .replace to invoke the function. All I need is for the replace string to contain the same number of CRLF as were in the original comment.
Can anybody please help.
Cheers
Being an old-fashioned mainframe techie I know nothing about JS but using the UE documentation and info gleaned from these fora I've managed to create a script to extract certain data from PL/I source code. As part of my data extract I need to preserve the line number on which code is situated. The first part of my script clears down all the comments in the program...
I initially used...
UltraEdit.activeDocument.findReplace.regExp=true;
UltraEdit.activeDocument.findReplace.replaceAll=true;
UltraEdit.perlReOn();
UltraEdit.activeDocument.top();
var searchRegexp = "/\\*(.|[\\r\\n])*?\\*/";
UltraEdit.activeDocument.findReplace.replace(searchRegexp,"");
This is fine for comments wholly on a single line, but if a comment spans several lines I need the comment to be replaced with the same number of blank lines so as to preserve subsequent line numbers.
I did some reading on findreplace.replace and it seems to indicate that the 2nd argument can be a function. Is this true in the implementation of JavaScript in UE? I've tried all sorts but can't seem to get .replace to invoke the function. All I need is for the replace string to contain the same number of CRLF as were in the original comment.
Can anybody please help.
Cheers