*************************************************************
Here is the use statement in the agent
*************************************************************
Option Public
Use "Trans4mRoutines"

**************************************************************
Here is the agent code that throws the error.
***************************************************************
Sub ExamineDocs()
Set sNotes = New NotesSession
Set dbNotes = s.CurrentDatabase
Set vwNotes = dbNotes.GetView("($All)")
Set docNotes = vwNotes.GetFirstDocument
Dim Result As Integer

' Open TRANS4M Session
Result = OpenT4m() **** This line throws the error ****
If (Result = 0) Then
If (OpenT4mFile("A_P-PAYMENT-HIST_MA") = "") Then *** No erroron this Function call ***
Call CloseT4m() *** No error on this subroutine call ***
Goto EndProgram
End If
Else
Goto EndProgram
End If
.
.
.
.
End Sub

The reason that the bad function declaration worked on the other statements is that you explicitly declared Result As Integer. When no return type is specified (which is really not very good style) the default return type of variant is used. When you do not declare variables they are also variants. Good coding style would be to declare everything, other languages that you may use in the future will not be so flexible in allowing you to declare types when you like and not when you don't. The consultant firm I worked for was real real rigid about declaring everything and capitalizing everything the same way. This turned out to be helpful later.

Featured Post

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

For Desktop Techs:
How to retain a user's Notes configuration data when swapping out the end user's computer.
(Assuming that you are not upgrading to a completely different version of Notes client)
All you need to do is:
1) install Notes o…

Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…