Page 1 of 1

Calling a NeoBook function from VBScript function...

PostPosted: Fri Oct 24, 2008 11:26 pm
by David de Argentina
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

PostPosted: Sat Oct 25, 2008 12:13 am
by sakismorGR
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.

PostPosted: Sun Oct 26, 2008 9:22 am
by Gaev
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""" )

PostPosted: Sun Oct 26, 2008 12:23 pm
by David de Argentina
WOW !!!

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


Thanks a lot !!

David de Argentina

PostPosted: Mon Oct 27, 2008 10:11 am
by David de Argentina
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

PostPosted: Mon Oct 27, 2008 11:18 am
by Neosoft Support
NeoBook v5.6.1 English help file:

http://www.neosoftware.com/software/nbw56-help.zip

PostPosted: Mon Oct 27, 2008 11:38 am
by David de Argentina
Thanks Dave,

Spanish help file is not updated.

Greetings from Buenos Aires,

David de Argentina

PostPosted: Wed Apr 28, 2010 2:42 pm
by David de Argentina
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

PostPosted: Wed Apr 28, 2010 5:05 pm
by Gaev
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.

PostPosted: Thu Apr 29, 2010 11:31 am
by David de Argentina
Thanks Gaev,

I did something like your code and worked fine.

Greetings from Buenos Aires,
David de Argentina