Skip to content

Instantly share code, notes, and snippets.

@RNJarvis
RNJarvis / SeparatorPageDelete
Last active September 20, 2019 16:54
Small routine to loop all documents of the batch, deleting specific pages based on certain criteria.
Public Sub SeparatorPageDelete(ByVal pXRootFolder As CASCADELib.CscXFolder)
On Error GoTo ErrorHandler
OutputDebugString "Scansation.SeparatorPageDelete"
Dim i As Long
Dim oXdoc As CscXDocument
Dim lPageIndex As Long
If Project.ScriptVariables.ItemByName("SeparatorPageDelete").Value = "True" Then
OutputDebugString "Scansation.Separator page removal enabled, deleting seperator pages..."
@RNJarvis
RNJarvis / IsRegexMatch
Created July 26, 2019 14:48
Use KTM Format Locator / Regex Flavor to perform string matching. This is useful when wanting to match how KTM performs regex searches within format locators.
Public Function IsRegexMatch(ByVal strRegex As String, ByVal strTest As String, ByVal bWholeWord As Boolean, ByVal bIgnoreCase As Boolean, ByVal bIgnoreBlanks As Boolean) As Boolean
OutputDebugString "Scansation.IsRegexMatch"
OutputDebugString "Scansation.strRegex: " & CStr(strRegex)
OutputDebugString "Scansation.strTest: " & CStr(strTest)
OutputDebugString "Scansation.bWholeWord: " & CStr(bWholeWord)
OutputDebugString "Scansation.bIgnoreCase: " & CStr(bIgnoreCase)
OutputDebugString "Scansation.bIgnoreBlanks: " & CStr(bIgnoreBlanks)
Dim fd As CscRegExpLib.CscFormatDefinition
Dim floc As New CscRegExpLib.CscFormatLocator
@RNJarvis
RNJarvis / 0_reuse_code.js
Created August 15, 2016 19:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console