Manage Learn to apply best practices and optimize your operations.

Hide code in Script Library

Do you want protect your work? Create a button in a form, and copy the following code:

Do you want protect your work? Create a button in a form, and copy the code below:

Note: In the Script Library there are two types of code:
1 - not compiled (that I can see, contained in $ScriptLib field)
2 - compiled (that I can not see, contained in $ScriptLib_O filed)

When I save a Script Library the content in $ScriptLib is Compiled in $ScriptLib_O field and the Lotus database use the last one.

This tip deletes the field $ScriptLib and leaves the field $ScriptLib_O, so that the library is available to use but I can't see the code.

'Declarations (button)
Const NOTE_CLASS_FILTER = &H0200 

Declare Private Function WinNSFDbOpen Lib "nnotes" Alias "NSFDbOpen" 
( Byval dbname As Lmbcs String, dbhandle As Long ) As Integer Declare Private Function WinNSFDbGetModifiedNoteTable Lib "nnotes"
Alias "NSFDbGetModifiedNoteTable"( Byval dbhandle As Long, Byval
classmask As Integer, Byval startdate As Double, endate As Double,
returntablehandle As Long ) As Integer Declare Private Function WinIDEntries Lib "nnotes"Alias "IDEntries"(
Byval tablehandle As Long ) As Long Declare Private Function WinIDScan Lib "nnotes" Alias "IDScan"( Byval
tablehandle As Long, Byval firstbool As Integer, returnid As Long) As Integer Declare Private Function WinOSMemFree Lib "nnotes" Alias "OSMemFree"
(Byval handle As Long) As Integer Declare Private Function WinNSFDbClose Lib "nnotes" Alias "NSFDbClose"
( Byval dbhandle As Long) As Integer Declare Private Sub WinTimeConstruct Lib "nnotes" Alias "TimeConstruct"
( Byval adate As Long, Byval atime As Long, datetime As Double) 'on Click Dim session As New NotesSession Dim db As NotesDatabase Dim dbhandle As Long Dim path As String Dim begindate As Double Dim enddate As Double Dim idtablehandle As Long Dim noteid As Long Dim count As Integer Dim note As Variant Set db = session.currentDatabase If db.server = "" Then path = db.filepath Else path = db.server & "!!" & db.filepath End If Call winNSFDBOpen(path, dbhandle) Call winTimeConstruct( &hFFFFFFFF, &hFFFFFFFF, begindate ) On Error Goto errSub Call winNSFDbGetModifiedNoteTable( dbhandle, NOTE_CLASS_FILTER, begindate , enddate , idtablehandle ) If winIDEntries( idtablehandle) <>0 Then If winIDScan( idtablehandle, True, noteid ) Then Do While winIDScan( idtablehandle, False, noteid ) Set note = db.getDocumentByID(Hex$( noteId)) If Not note Is Nothing Then If note.getItemValue( "$Flags")(0) Like "*[s]*"Then If note.hasItem("$ScriptLib") Then Call note.RemoveItem("$ScriptLib") Call note.save(True, False, True) End If End If End If Loop End If End If exitSub: If idtablehandle <> 0 Then Call winOsMemFree( idtablehandle) End If If dbhandle <> 0 Then Call winNSFDbClose( dbhandle) End If Exit Sub errSub: Resume exitSub

Dig Deeper on HTML for Lotus Notes Domino

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close