Source language: Translate to:

hpwNewLISP

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

hpwNewLISP

Postby dcaqu » Mon Nov 20, 2006 10:58 am

Hi,
We downloaded the hpwNewLISP plug-in but it's not intuitive how to use it is there a help file anywhere or other driving instructions? Also there's lots of files in the download zip file apart from the NeoBook plugin are we supposed to have them in a specific folder (NeoBook?) in order for it all to work? Finally there's a NeoSoftware runtime plug-in does this need to be distributed with any compiled pub that uses the plug-in for it to work?

Thanks in advance for any help or suggestions.

Dave :D
User avatar
dcaqu
 
Posts: 9
Joined: Wed Jun 28, 2006 12:40 am
Location: Worcs U.K.

Postby HPW » Mon Nov 20, 2006 11:40 am

is there a help file anywhere or other driving instructions?


You should study the hpwNewLISP.pub and there the first page.

There are in fact 2 commands to get a basic call running:

hpwSetNewLispDir "[PubDir]"

Tells the plugin where to search the newLISP.dll
(It must be somewhere to find so you have to deliver it)

hpwNewLispCall "(YourlispCodeHere )" "[OptionalReturnVariable]"

Calls the lispfunction and returns a string if you want.

You may also have a look at the standalone-newLISP found here:

www.newLISP.org

Finally there's a NeoSoftware runtime plug-in does this need to be distributed with any compiled pub that uses the plug-in for it to work?


When you use the commands the NBR is automaticly embedded in the neobook app. You may extract the newLISP.dll or deliver it with your installer.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Sam Cox » Mon Nov 20, 2006 11:44 am

The hpwNewLisp plug-in is an interface to the Lisp programming language as implemented by Lutz Mueller at www.newlisp.org. newLisp is an extremely powerful and well-supported/documented implementation of Lisp.

The plug-in was written and is actively supported by Hans-Peter Wickern (a.k.a., HPW). The plug-in comes with and requires newlisp.dll.

Here is a simple example of using the plug-in.
Code: Select all
.this code in STARTUP
.specifies location of newlisp.dll
hpwSetNewLispDir "[pubdir]"

Note: You can embed the newlisp.dll file inside of your pub (it's not large) and extract it to [pubdir] if it does not already exist in that directory.

The syntax of calling newLisp functions from within Neobook is:
Code: Select all
.this code executes a lisp command from within Neobook
hpwNewLispCall "(newLispCommandName {[neoVariable]})" "[resultVariable]"

A very simple example:
Code: Select all
hpwNewLispCall "(upper-case {this is a test})" "[test]"

After executing, the Neobook variable [test] contains "THIS IS A TEST".

Another example (taken from the newLisp manual):
Code: Select all
hpwNewLispCall "(irr '(-1000 500 400 300 200 100) '(0 3 4 5 6 7))" "[result]"

After executing, [result] = "0.0998"

You can, of course, write your own Lisp functions and execute them from Neobook. The function definitions can be defined within Neobook or loaded from an external file.
Code: Select all
.load lisp function def's from external file
hpwNewLispCall "(load {[pubdir]mydefs.lsp})" "[result]"
If "[result]" "<>" "true"
   AlertBox "ERROR" "Failed to load external definitions"
   Exit "" ""
Endif
User avatar
Sam Cox
 
Posts: 768
Joined: Fri Apr 01, 2005 7:30 am
Location: Loveland CO USA

Postby dcaqu » Mon Nov 20, 2006 1:32 pm

Hi Hans Peter,
Thanks for the fast response. When I run the pub I get errors such as "I don't understand this command" and this is one of the commands it doesn't like, there are several,-

hpwImageCreate "RImage1" "AlertBox [#34]Test[#34] [#34]Lclick at RImage1_LClickX / RImage1_LClickY[#34]" "AlertBox [#34]Test[#34] [#34]Rclick at RImage1_RClickX / RImage1_RClickY[#34][#13][#10][#13][#10]" "AlertBox [#34]Test[#34] [#34]Mclick at RImage1_MClickX / RImage1_MClickY[#34][#13][#10]" "" "". The hpwImageCreate is not highlighted in blue in the editor.

Anyway bacause of that I gave up exploring the pub.

Maybe I'm just being dumb but at the moment how I use your plug in is eluding me. I'm confident it's a fantastic app if only I can work out how it works.

Any further help will be gratefully received.

Hi Sam,
I'll have a go at working through what you sent and the various reference sites.

Thanks again!

Dave :D
User avatar
dcaqu
 
Posts: 9
Joined: Wed Jun 28, 2006 12:40 am
Location: Worcs U.K.

Postby HPW » Mon Nov 20, 2006 1:47 pm

Thanks for the fast response. When I run the pub I get errors such as "I don't understand this command" and this is one of the commands it doesn't like, there are several


For trying out the graphic sample you have to install the hpwImage-plugin.
It is used for the lisp-driven graphic.

Also plugin hpwColormemo is used to display colored source of the demo-lisps.

In fact the demo is not a hpwNewLISP-only demo! ;-)

Most of my plugin have special newLISP direct-call interfaces to allow newLISP to call other plugins directly.
Hans-Peter
User avatar
HPW
 
Posts: 2510
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest