Du musst die ScriptLib lib.appl.NotesAPI entsprechend abändern.
Deklaration
Declare Function NEMGetFile Lib "nnotesws" ( wUnk As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
Declare Function LX_NEMGetFile Lib "libnotes.so" Alias "NEMGetFile"( wUnk As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
Declare Function MAC_NEMGetFile Lib "NotesLib" Alias "NEMGetFile"( wUnk As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
Declare Function NEMPutFile Lib "nnotesws" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
Declare Function LX_NEMPutFile Lib "libnotes.so" Alias "NEMPutFile" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
Declare Function MAC_NEMPutFile Lib "NotesLib" Alias "NEMPutFile" ( wHandle As Integer, Byval szFileName As String, Byval szFilter As String, Byval szTitle As String ) As Integer
' WIN
Declare Function NSFFormulaCompile Lib "nnotes.dll" ( _
Byval FormulaName As Long, _
Byval FormulaNameLength As Integer, _
Byval FormulaText As Lmbcs String, _
Byval FormulaTextLength As Integer, _
rethFormula As Long, _
retFormulaLength As Integer, _
retCompileError As Integer, _
retCompileErrorLine As Integer, _
retCompileErrorColumn As Integer, _
retCompileErrorOffset As Integer, _
retCompileErrorLength As Integer _
) As Integer
Declare Sub OSMemFree Lib "nnotes.dll" (Byval hHandle As Long)
Declare Function OSLoadString Lib "nnotes.dll" ( _
Byval hmodule As Long, _
Byval status As Integer, _
Byval s As String, _
Byval slen As Integer _
) As Integer
' LINUX
Declare Function LX_NSFFormulaCompile Lib "libnotes.so" Alias "NSFFormulaCompile" ( _
Byval FormulaName As Long, _
Byval FormulaNameLength As Integer, _
Byval FormulaText As Lmbcs String, _
Byval FormulaTextLength As Integer, _
rethFormula As Long, _
retFormulaLength As Integer, _
retCompileError As Integer, _
retCompileErrorLine As Integer, _
retCompileErrorColumn As Integer, _
retCompileErrorOffset As Integer, _
retCompileErrorLength As Integer _
) As Integer
Declare Sub LX_OSMemFree Lib "libnotes.so" Alias "OSMemFree" (Byval hHandle As Long)
Declare Function LX_OSLoadString Lib "libnotes.so" Alias "OSLoadString" ( _
Byval hmodule As Long, _
Byval status As Integer, _
Byval s As String, _
Byval slen As Integer _
) As Integer
' MAC
Declare Function MAC_NSFFormulaCompile Lib "NotesLib" Alias "NSFFormulaCompile" ( _
Byval FormulaName As Long, _
Byval FormulaNameLength As Integer, _
Byval FormulaText As Lmbcs String, _
Byval FormulaTextLength As Integer, _
rethFormula As Long, _
retFormulaLength As Integer, _
retCompileError As Integer, _
retCompileErrorLine As Integer, _
retCompileErrorColumn As Integer, _
retCompileErrorOffset As Integer, _
retCompileErrorLength As Integer _
) As Integer
Declare Sub MAC_OSMemFree Lib "NotesLib" Alias "OSMemFree" (Byval hHandle As Long)
Declare Function MAC_OSLoadString Lib "NotesLib" Alias "OSLoadString" ( _
Byval hmodule As Long, _
Byval status As Integer, _
Byval s As String, _
Byval slen As Integer _
) As Integer
Const NULLHANDLE = 0
Const NO_ERROR = 0
Const ERR_FORMULA_COMPILATION = &h500 + 1
' ================================================================================
' CheckSelectionFormulaValid - This function uses the Lotus C API to check thesyntax of a Notes formula.
'
' Return Value: Variant - A 3 elements array containing:
' Index 0 - The compilation error code or NO_ERROR (0) if valid
' Index 1 - The compilation error offset in formula or NO_ERROR if valid
' Index 2 - The compilation error length or NO_ERROR if valid
'
' Note: The compilation error code at Index 0 can then be passed to GetAPIError () to get more info about the error.
' ================================================================================
' ================================================================================
' GetAPIError - This function uses the Lotus C API to return a Notes error's text message.
'
' Return Value: String - The text associated with the Notes API error code.
' ================================================================================
Und dann noch die einzelnen Funktionen
Function CheckSelectionFormulaValid(sFormula) As Variant
Dim iError As Integer
Dim hFormula As Long
Dim wFormulaLen As Integer
Dim iCompileError As Integer
Dim iCompileErrorLine As Integer
Dim iCompileErrorColumn As Integer
Dim iCompileErrorOffset As Integer
Dim iCompileErrorLength As Integer
Dim iArray(2) As Integer
Dim szVersion As String
szVersion = get_platform()
Select Case szVersion
Case "w32"
iError = NSFFormulaCompile(0, 0, _
sFormula, _
Len(sFormula), _
hFormula, _
wFormulaLen, _
iCompileError, _
iCompileErrorLine, _
iCompileErrorColumn, _
iCompileErrorOffset, _
iCompileErrorLength)
Case "linux"
iError = LX_NSFFormulaCompile(0, 0, _
sFormula, _
Len(sFormula), _
hFormula, _
wFormulaLen, _
iCompileError, _
iCompileErrorLine, _
iCompileErrorColumn, _
iCompileErrorOffset, _
iCompileErrorLength)
Case "mac"
iError = MAC_NSFFormulaCompile(0, 0, _
sFormula, _
Len(sFormula), _
hFormula, _
wFormulaLen, _
iCompileError, _
iCompileErrorLine, _
iCompileErrorColumn, _
iCompileErrorOffset, _
iCompileErrorLength)
End Select
If hFormula <> NULLHANDLE Then
Select Case szVersion
Case "w32"
Call OSMemFree(hFormula)
Case "linux"
Call LX_OSMemFree(hFormula)
Case "mac"
Call MAC_OSMemFree(hFormula)
End Select
End If
If iError = ERR_FORMULA_COMPILATION Then
iArray(0) = iCompileError
iArray(1) = iCompileErrorOffset
iArray(2) = iCompileErrorLength
CheckSelectionFormulaValid = iArray
Else
iArray(0) = NO_ERROR
iArray(1) = NO_ERROR
iArray(2) = NO_ERROR
CheckSelectionFormulaValid = iArray
End If
End Function
Function get_platform () As String
Dim tmp_platform As Variant
Dim lower_platform As String
tmp_platform = Evaluate(|@Implode(@Platform([Specific]);" ")|)
lower_platform = Lcase(Cstr(tmp_platform(0)))
If (Instr (lower_platform, "linux")) Then
get_platform = "linux"
Elseif (Instr (lower_platform, "win")) Then
get_platform = "w32"
Elseif (Instr (lower_platform, "mac")) Then
get_platform = "mac"
Else
Print "Unsupported Platform : >" + lower_platform + "<"
get_platform = ""
End If
End Function
Function GetAPIError(iErrorCode As Integer) As String
Dim iRetVal As Integer
Dim sError As String * 1024
Dim szVersion As String
szVersion = get_platform()
sError = String(1024, 0)
Select Case szVersion
Case "w32"
iRetVal = OSLoadString(0&, iErrorCode, sError, 1023)
Case "linux"
iRetVal = LX_OSLoadString(0&, iErrorCode, sError, 1023)
Case "mac"
iRetVal = MAC_OSLoadString(0&, iErrorCode, sError, 1023)
End Select
End Function
Kann es nicht testen, da ich keinen Mac habe; daher keine Garantie.