Source language: Translate to:

Other language

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Other language

Postby Alex » Sat Nov 14, 2009 12:58 pm

Hi,

I want to know if it is possible to program in Neobook with and other language that Neobook, like VBS or VB or C or Java... I know that I can program in VBS in a WebBrowser object and in Call's function.

But I need to execute the code from a text file (for example using hpwPlayAction, but I don't know if it will work with other languages).

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Neosoft Support » Mon Nov 16, 2009 11:40 am

You can create functions (executed with the Call action) in VBScript or JavaScript. NeoBook cannot execute Visual Basic, C or Delphi syntax on its own. If you need execute something written in those languages then you will need to create a plug-in.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Alex » Tue Nov 17, 2009 2:41 am

Hi Neosoft,

Excellent, thanks.


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby Alex » Tue Nov 17, 2009 4:55 am

Hi again,

I made:

A pub with a pushbutton where there is:
Code: Select all
Call "TEST"

The TEST file where I put:
Code: Select all
FileRead "![PubDir]text.txt" "All" "[textcode]"
hpwPlayAction "[textcode]" "1"

Ans in the text.txt file I put the VBScript Example to open Notepad:
Code: Select all
{NeoBook Function}
Version=5.60
Language=VBScript
Comment=This example opens Notepad.
{End}
'This example opens Notepad

dim oWs

Set oWS = CreateObject("WScript.Shell")

oWS.Run "notepad.exe"


But it doesn't work, I think that hpwPlayAction read only Neobook code, the same for nbejecutar from NeoDouble.
Is there a plugin or function to read the VBScript from a file and execute it from the Call action?

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am

Postby HPW » Tue Nov 17, 2009 5:18 am

hpwPlayAction is for native neoscript code and play it with the SDK-function nbPlayAction. So does not help here.

But what you want is supported by the native 'call' command.

Place your code:
Code: Select all
{NeoBook Function}
Version=5.60
Language=VBScript
Comment=This example opens Notepad.
{End}
'This example opens Notepad

dim oWs

Set oWS = CreateObject("WScript.Shell")

oWS.Run "notepad.exe"


inside a text-file 'Testcall' and save it without any extension for the filename into the directory of your final EXE.

Then place:

Code: Select all
Call "TestCall"


inside your Test-button. (Without any pathinfo)
When compiling, neobook will complain about the missing function in the function-library.
But when you call it then at runtime, the command will search in its directory for a file with the same name and without any extension.
This will be executed.
The only drawback is, that your code becomes visible to the outside file-system.
But you can create it dynamicly on the fly and delete it afterwards.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Alex » Tue Nov 17, 2009 5:54 am

Hi HPW,

Thank you very much. It works good.

Thanks


Alex
Alex
 
Posts: 745
Joined: Sat Mar 04, 2006 4:53 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests

cron