Source language: Translate to:

Calling a NeoBook function from VBScript function...

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Calling a NeoBook function from VBScript function...

Postby David de Argentina » Fri Oct 24, 2008 11:26 pm

Hi all,

I don't know enough about VBScript.

Are there any way to call a NeoBook function from a VBscript function ?

I imagine this scenario:

I have a VBScript function doing a eternal loop checking a service (COM port, Internet port.. or something like this )

When a event is detected, I guess I need launch a NeoBook function, in order to do an specific process ( write data, change text objects, etc )

After this, the VBScript function continues looping...

Is this possible ?

any ideas ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby sakismorGR » Sat Oct 25, 2008 12:13 am

Yes it is possible to call an action and to take variables from a vbscript. If it possible send the vb script code to check it.
User avatar
sakismorGR
 
Posts: 91
Joined: Sat Apr 29, 2006 10:21 pm
Location: Kavala-Greece

Postby Gaev » Sun Oct 26, 2008 9:22 am

David de Argentina:

From the Help file ...
nbExecAction

Purpose:
Use this method to execute NeoBook actions.

Syntax:
publication.nbExecAction( "action script" )

action script
The NeoBook action to execute. Multiple actions may specified by separating them with a carriage return.

Example:
This example executes NeoBook's AlertBox action:

publication.nbExecAction( "AlertBox ""Hello"" ""Hello from the Web Browser!""" )

... could also do things like ...
Code: Select all
myVbsVar1 = publication.nbGetVar( "[myNeoBookVariableABC]" )

myVbsVar2 = myVbsVar1 + 45
publication.nbSetVar "[myNeoBookVariableABC]", myVbsVar2

publication.nbExecAction( "GoSub ""myNeoBookSubRoutine123""" )
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Sun Oct 26, 2008 12:23 pm

WOW !!!

I can see the light ... my brother... !!! :lol:


Thanks a lot !!

David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby David de Argentina » Mon Oct 27, 2008 10:11 am

Gaev said: "From the Help file ..."

After check the Spanish Manual of Neo 5.6.1, I didn't find any about them.
All info are redirected to the WebBrowser Object help.


Dave: could you upload a link with the English manual ?
I guess there are another topics Spanish Manual don't have...

Thanks in advance,

David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Neosoft Support » Mon Oct 27, 2008 11:18 am

NeoBook v5.6.1 English help file:

http://www.neosoftware.com/software/nbw56-help.zip
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby David de Argentina » Mon Oct 27, 2008 11:38 am

Thanks Dave,

Spanish help file is not updated.

Greetings from Buenos Aires,

David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby David de Argentina » Wed Apr 28, 2010 2:42 pm

Hi all,

I need catch an event from the webbrowser.

If I launch:

BrowserLoadFromStr "NavegadorWeb1" "<marquee behavior=alternate scrollAmount='3' scrolldelay='5' bgcolor='99CCFF' LOOP='1' onfinish=[#34]alert('Marquee finished looping')[#34]>Some text here</marquee>"

Everything works fine.

but, If I launch:

BrowserLoadFromStr "NavegadorWeb1" "<marquee behavior=alternate scrollAmount='3' scrolldelay='5' bgcolor='99CCFF' LOOP='1' onfinish=[#34]neobook:Gosub %22My_Function%22[#34]>Some Text here</marquee>"

or

BrowserLoadFromStr "NavegadorWeb1" "<marquee behavior=alternate scrollAmount='3' scrolldelay='5' bgcolor='99CCFF' LOOP='1' onfinish=[#34]publication.nbExecAction( [#34]GoSub [#34][#34]myNeoBookSubRoutine123[#34][#34][#34] )[#34]>Some Text here</marquee>"

The marquee works fine but I can't catch the onfinish event.

Any ideas ?

Thanks in advance,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Postby Gaev » Wed Apr 28, 2010 5:05 pm

David de Argentina:

a) the <marquee ...> tag is no longer supported.

b) The BrowserLoadFromStr command is generally used to load a complete HTML Document.


I suggest you place this code ...
Code: Select all
<html>
<head>
<script language="JScript">
function DoExec() {
  window.external.nbExecAction('AlertBox "Hello" "Hello from the Web Browser!"' );
  window.external.nbExecAction('Gosub "My_Function"');
}
</script>
</head>
<body>
<marquee behavior=alternate scrollAmount='3' scrolldelay='5' bgcolor='99CCFF' LOOP='1' onfinish="DoExec();">Some text here</marquee>
</body>
</html>
... in an external text file ... then do ...
Code: Select all
FileRead "[PubDir]myText.txt" "All" "[myLoadStr]"
BrowserLoadFromStr "NavegadorWeb1" "[myLoadStr]"


Once that works ... you can embed myText.txt in your pub.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby David de Argentina » Thu Apr 29, 2010 11:31 am

Thanks Gaev,

I did something like your code and worked fine.

Greetings from Buenos Aires,
David de Argentina
User avatar
David de Argentina
 
Posts: 1553
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 2 guests