Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - HPW

#21
newLISP in the real world / newlisp-js license?
January 05, 2014, 02:35:42 AM
Hello Lutz,



Most JavaScript Frameworks and library's can be used under MIT-license:



http://en.wikipedia.org/wiki/MIT_License">http://en.wikipedia.org/wiki/MIT_License



How does newlisp-js fit in such enviroment?

Can it be used in combination with this Frameworks and with own js and Lisp-code?

Or are own js/lisp again data for the Interpreter?



Regards
#22
newLISP in the real world / java app using newlisp.dll ?
September 14, 2013, 11:18:20 PM
Hello,



Is it possible to write a windows-Java app (jar) which uses newlisp.dll as ist engine ?



The newlisp IDE is a Java app, but uses newlisp.exe in a separate process and communicates with it.

(I see 2 processes in the taskmanager)



So can I use Java like other enviroments with embedded newlisp within one process?

Callback-Support?

Sample?



Regards
#23
When I want to do the same as with the longtime depreciated 'replace-assoc' it would be this:



> (set 'data '(fruits (apples 123 44) (oranges 1 5 3)))
(fruits (apples 123 44) (oranges 1 5 3))
> (set-ref (assoc 'apples data) data '(Apples 456 55))
(fruits (Apples 456 55) (oranges 1 5 3))


Makes for me more sense as a real world example.



Regards
#24
Anything else we might add? / Sikuli script
June 18, 2013, 11:17:16 PM
Hello,



Another very nice tool for the toolbox:



http://www.sikuli.org/index.html">http://www.sikuli.org/index.html



For everyone who need something to automate tasks or testing.

Based on java/python.

Multiplatform.



Regards
#25
Is this right that curly bracket string and symbols are not allowed to direkt follow each other?

> (setq Test 10)
10
> (setq Test1 (string {Bla}Test{Bla1}))
Blanil
> (setq Test1 (string {Bla} Test {Bla1}))
Bla10Bla1


Or Bug?
#26
newLISP in the real world / DLL init.lsp problem
September 05, 2012, 03:25:12 AM
Edit: Forget my post. I got a reference to init.lsp myself in my code.

















I have a problem with the DLL on windows.

I load it and get an error:



4 ERR: problem accessing file in function load : "C:/Programme/NeoBook5/Plugins/hpwNewLISP/Deliver//init.lsp"


Quote
When newLISP is run as a shared library, an initialization file is looked for in the environment variable NEWLISPLIB_INIT. The full path-name of the initialization file must be specified. If NEWLISPLIB_INIT is not defined, no initialization file will be loaded by the library module.


There is no env-var NEWLISPLIB_INIT and no init.lsp file.

So why the error?
#27
Hello,



What is the fastest way to check if a string is a valid number or not?

Or other way round to check it is a valid string only starting with a num char?

I have for example a string "1KR60". (float ) and (int ) makes a numer from it.

Would it be to check the string contain any ALPHA-chars?

A regex?



Regards



Hans-Peter
#28
Hello,



I have a question about differences between deleting a symbol vs setting a symbol to nil.

When I do some housekeeping myself and want to get a unused symbol out of the (symbols) list,

I use (delete 'symbolname) to delete the content and the symbol itself.



What the difference between them in memory usage?

Is deleting and recreating a symbol the same performance as nil it an reused it later?



Regards



Hans-Peter
#29
Hello,



Running newLISP.DLL from a neobook host application gave me an 'external exception C0000029'.

Googling the error let me guess that it is somewhat stack-related.

It happend in my project where a OnChange-event triggers a newLISP call which fired the OnChange-events from other objects with their own newLISP-calls.

This seems the problem and my workaround was to implement a switch that avoid this OnChange-chain.



Just want to post for others who might get this error.



Regards
#30
Hello,



I am thinking about a little tool to print all combinations of a string with length 3.

On each pos can be 'A' or 'B' or 'C'.

So I know that it gives 3 * 3 = 27 combinations

AAA

BBB

CCC

...



Anyone an idea to do this lispisch in newLISP?

Generic algo possible with variable length and variable number of possible chars?
#31
Hello,



In the neobook forum was a discussion how to create masses of neobook-variables fast.



http://www.neosoftware.com/forum/viewtopic.php?t=19228">http://www.neosoftware.com/forum/viewtopic.php?t=19228



What is again very impressive that newlisp outperforms nativ delphi-plugin function a bit.

Reading the example list with 2500 pairs of variable-name and their values and push them through the interface into the neobook adress-space was really fast.



:-))
#32
Hello,



Inspired by this articel:



https://github.com/davidbl/acadhelper/wiki/Ruby-talks-to-AutoLISP">https://github.com/davidbl/acadhelper/w ... o-AutoLISP">https://github.com/davidbl/acadhelper/wiki/Ruby-talks-to-AutoLISP



I tried similar from newLISP.exe to a running instance of autocad 2006

(I checked the exported function name with dependency walker.)



newLISP v.10.4.0 on Win32 IPv4/6, execute 'newlisp -h' for more info.

> (import "C:\Programme\AutoCAD 2006\acad.exe" "?acedEvaluateLisp@@YAHPBDAAPA
Uresbuf@@@Z" "cdecl")
?acedEvaluateLisp@@YAHPBDAAPAUresbuf@@@Z@11745F0
>


Import seems to get the entry point.

But when I try

(setq resbuffer "                       ")
(?acedEvaluateLisp@@YAHPBDAAPAUresbuf@@@Z "(setq Test1 100)" resbuffer)

newLISP crashes.



Any idea what can be wrong?



Regards



Hans-Peter
#33
Hello,



I try to test the callback from newlisp.dll to newlisp.exe



(import "user32.dll" "MessageBoxA")
(import "newlisp.dll" "newlispEvalStr")
(define (mycallback stext)
(eval-string stext)
)
(setq callbackadr(callback 0 'mycallback))
(MessageBoxA 0 (string "This is callbackadr: " callbackadr) "newLISP EXE" 0)

(setq newlispstr (string "(setq nlmaincallback print)(cpymem(pack "ld" 265)(first(dump nlmaincallback))4)(cpymem(pack "ld" "callbackadr")(+(first(dump nlmaincallback))12)4)(cpymem(pack "ld" "nlmaincallback")(+(first(dump nlmaincallback))8)4)"))
(MessageBoxA 0 (string "This is newlispstr: " newlispstr) "newLISP EXE" 0)
(newlispEvalStr newlispstr)
(MessageBoxA 0 (string "This is next step") "newLISP EXE" 0)

(MessageBoxA 0 (mycallback "(string(symbols))") "newLISP EXE" 0)

(MessageBoxA 0 (newlispEvalStr "(nlmaincallback "(string(symbols))")") "newLISP EXE" 0)


Last line does not work. Show's a -1.

So is it possible to callback newLISP.exe from newlisp.dll ?
#34
Hello Lutz,



I am unsure about using the callback function.

The doc states that it support up to 8 parameters.

But what type does the parameters support?

Are they always PChar/Strings ?



And does the callback-function support a return value ? Of which type?
#35
Hello,



For the pdScript-DLL calling from newLISP.exe I ran into problem to get back a delphi PAnsiChar out buffer.



delphi-definition:

function pdScriptInlineExLibA(ScriptCode:PAnsiChar; ScriptDFM: PAnsiChar; Params:PAnsiChar; SyntaxCheckOnly:Bool; out pStdOut: PAnsiChar; LibraryPath:PAnsiChar): Integer; stdcall;


I do:

(import "pdScriptE.dll" "pdScriptInlineExLibA")
(import "pdScriptE.dll" "pdsFreeMem")
(setq DpasText ....)
(setq DfmText ...)
(setq DpasParam "")
(setq DpasOutPutBuffer (dup "." 2000)) ;allocating buffer but this is nonsens because out-buffer only
(setq DpasLibPath "")
(setq scriptresult(pdScriptInlineExLibA DpasText DfmText DpasParam 0 DpasOutPutBuffer DpasLibPath))
(setq OutPutBuffer (get-string DpasOutPutBuffer))
(MessageBoxA 0 (string "This is pdScript return-value: " scriptresult) "pdScript Test" 0)
(MessageBoxA 0 (string "This is pdScript output buffer: " OutPutBuffer) "pdScript Test" 0)
(pdsFreeMem DpasOutPutBuffer)

All other params are passed fine and work as expected.

The OutPutBuffer shows nothing or strange chars.

The pdsFreeMem crashes newLISP.



Here the comment from the pdScript developer:
Quote
Hi,



I don't think there is something non-standard, because we are using only pointers (PAnsiChar in this case) and "stdcall" directive.

Please, do not create a new wrapper - let's try to solve it in an easy way.



In short, you have to use an equivalent of PAnsiChar for DpasOutPutBuffer, pass it to the pdScriptInlineExLibA function and release it with pdsFreeMem on finish. Nothing more. I guess the problem is in the variable type, because it seems, that your DpasOutPutBuffer is a simple string, not a pointer to chars. But I don't know how to define such a variable in newLISP, if it is possible at all.



About pdsFreeMem - you should call it with parameter: pdsFreeMem(DpasOutPutBuffer), but when you simply remove the line with DpasOutPutBuffer declaration, it is clear, that it will crash, because when you do not pass any PAnsiChar pointer to pdScriptInlineExLibA, then the output buffer is not allocated at all.



Roman


Any idea how to call such function with out-parameter?



Regards



Hans-Peter
#36
newLISP in the real world / pdScript with newLISP.dll
August 08, 2011, 12:22:48 AM
Hello,



I recently ran across pdScript which is a scripting interpreter build on top of remobjects pascalscript.

It allows to do GUI scripting under windows. Since it is light-weight itself, it fits good to newLISP.



I contacted the pdScript guys to ask them for some improvements for best newLISP intergration.

With the release of pdScript 1.5.5 the improvements are in place.

Thanks to the guys from precision who are open for user requests.



Interested may have a look at my sample posted here:



http://www.be-precision.com/forum/index.php?topic=162">http://www.be-precision.com/forum/index.php?topic=162



The sample shows how to call newLISP and how to support callbacks with up to 9 parameter.



The interpreter is free but the nice IDE will become shareware in the future.

The current IDE-beta is free.



Regards



Hans-Peter
#37
Hello,



I had installed newLISP on a fresh W7 PC.

I started installation from a user-account and after asking the admin password it installs.

So far it runs fine.



But using newLISP DLL from other envriments shows a problem.



The newLISP installer installs newLISP into the wanted path.

Besides the NEWLISPDIR variable it set the newLISP-path into the PATH-variable.



But it uses the user-PATH variable instead of the systemwide PATH-variable.



So now my LoadLibrary from the user-account fails, because the path-entry is only in the admin's Path-variable and fails.



So the installer of newLISP should put the path-info into the  systemwide PATH-variable.



Regards



Hans-Peter
#38
Hello,



for people interested in using the old newLISP-TK frontend for newLISP I updated the tcl code to run with the latest newLISP EXE. Some changes in the past let not run the code-browser/editor.



http://hpwsoft.de/anmeldung/html1/newLISP/newlisptk.zip">http://hpwsoft.de/anmeldung/html1/newLISP/newlisptk.zip



The ZIP contains the freewrap EXE and a sample config-file.
#39
The latest ultraedit 16.10.0.1021 has a interesting new feature for lisper:



A new feature (I would call it paranthesis line indicator) show on indented lisp code where each paranthesis close and what line are between it.

Before you have the option to navigate to the opening paranthesis and the the closing paranthesis  gets highlighted. You had also the option to hit CTRL-B to paranthes-check and highlight all code.



The new feature is the third option and show all block paranthesis instantly.



http://hpwsoft.de/anmeldung/html1/newLISP/nl_ue.png">
#40
I am thinking about a converter from bitmaps fonts to a lisp-format describing the needed Pixelgrid



Example letter bitmap 7 x 15 (zoomed):

http://hpwsoft.de/anmeldung/html1/newLISP/CharGrid.png">



I scan the bitmap vertical and horzontal and get 2 vector lists.

Bitmap: 7 x 15 Pixel

Vertical scan:

;     X1 Y1 X2 Y2       Length
(list  0 10  0 11)      ;2
(list  1  7  1  9)      ;3
(list  2  1  2  1)      ;1
(list  2  4  2  6)      ;3
(list  2  8  2  8)      ;1
(list  3  3  3  3)      ;1
(list  3  8  3  8)      ;1
(list  4  1  4  1)      ;1
(list  4  4  4  6)      ;3
(list  4  8  4  8)      ;1
(list  5  7  5  9)      ;3
(list  6 10  6 11)      ;2


Horizontal scan:

;     X1 Y1 X2 Y2       Length
(list  2  1  2  1)      ;1
(list  4  1  4  1)      ;1
(list  3  3  3  3)      ;1
(list  2  4  2  4)      ;1
(list  4  4  4  4)      ;1
(list  2  5  2  5)      ;1
(list  4  5  4  5)      ;1
(list  2  6  2  6)      ;1
(list  4  6  4  6)      ;1
(list  1  7  1  7)      ;1
(list  5  7  5  7)      ;1
(list  1  8  5  8)      ;5
(list  1  9  1  9)      ;1
(list  5  9  5  9)      ;1
(list  0 10  0 10)      ;1
(list  6 10  6 10)      ;1
(list  0 11  0 11)      ;1
(list  6 11  6 11)      ;1


So I want to draw the pixels with the vectors with the largest length and want to avoid double vectors.



Wanted Result:

(list  0 10  0 11)      ;2
(list  1  7  1  9)      ;3
(list  2  1  2  1)      ;1
(list  2  4  2  6)      ;3
(list  3  3  3  3)      ;1
(list  4  1  4  1)      ;1
(list  4  4  4  6)      ;3
(list  5  7  5  9)      ;3
(list  6 10  6 11)      ;2
(list  1  8  5  8)      ;5


Any lispish ideas?