Created
March 14, 2015 22:33
-
-
Save isapir/38f38c1ebf99a85b6da5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM ***** BASIC ***** | |
function getScriptVersion() | |
getScriptVersion = 1.04 | |
end function | |
function contains(str1 as Variant, str2 as Variant) | |
Dim oDocScriptProvider As Object, oScript As Object | |
oDocScriptProvider = ThisComponent.getScriptProvider() | |
oScript = oDocScriptProvider.getScript("vnd.sun.star.script:JSLib1.StringContains.js?language=JavaScript&location=document") | |
contains = oScript.invoke(Array(str1, str2), Array(), Array()) | |
end function | |
Sub TestJsCall | |
Dim oDocScriptProvider As Object, oScript As Object | |
Dim result As Variant | |
oDocScriptProvider = ThisComponent.getScriptProvider() | |
oScript = oDocScriptProvider.getScript("vnd.sun.star.script:JSLib1.StringContains.js?language=JavaScript&location=document") | |
result = oScript.invoke(Array("Apache OpenOffice is the best", "OpenOffice"), Array(), Array()) | |
MsgBox("Term exists : " & result) | |
End Sub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in JSLib1 | |
ARGUMENTS[0].indexOf(ARGUMENTS[1]) > -1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment